Code:

shell '%comspec% /c ping -n 1 128.2.0.1 | find "TTL=" > nul'
if not @error
? "128.2.0.1 is alive"
endif