Ok, if the IP address you are looking for is 176.4.16.23 your script should look like this:
code:
Break ON
$sIPAddress="176.4.16.23"
While "true"
Shell '%COMSPEC% /C ping -n 1 ' + $sIPAddress + ' | find "TTL=" >/dev/null'
If @ERROR=0
$Null=MessageBox("IP Address " + $sIPAddress + " is responding","It's Alive!")
Exit 0
EndIf
Sleep(60)
Loop
If you know the host name it will look like this (assuming the host is called "thehost.acme.com):
code:
Break ON
$sIPAddress="thehost.acme.com"
While "true"
Shell '%COMSPEC% /C ping -n 1 ' + $sIPAddress + ' | find "TTL=" >/dev/null'
If @ERROR=0
$Null=MessageBox("IP Address " + $sIPAddress + " is responding","It's Alive!")
Exit 0
EndIf
Sleep(60)
Loop
quote:
Adn this will put you into a continous loop: While "true"
It's supposed to
The "Exit 0" will exit the script once the ping succeeds, so the alert will only appear once. If the "Exit 0" is removed, the script will message (or beep or whatever) every 60 seconds.
AzzerShaw, the error you are getting probably means one of three things:
1) You don't have "ping" in your PATH
2) You don't have "find" in your PATH
3) You don't have %COMSPEC% set correctly