View Single Post
  #2  
Old 09-01-2020, 11:43 AM
bgagnon bgagnon is offline
VanDyke Technical Support
 
Join Date: Oct 2008
Posts: 4,482
Hi Knightmare,

You would want to use ReadString() instead of WaitForString() following sending the ping command so you actually capture the output so you can check it for the expected phrase.
Code:
crt.Screen.Send "ping 10.0.0.1" & vbcr
strResult = crt.Screen.ReadString("#")

If InStr(strResult, "100% packet loss") Then
    ' Run Command X
Else
    ' Run Command Y
End If
If your browser supports the site command (I know Edge does), you might run that with the search term ping because I think there are a few examples of this sprinkled throughout the forums (ie: site:forums.vandyke.com ping).
__________________
Thanks,
--Brenda

VanDyke Software
Technical Support
support@vandyke.com
(505) 332-5730

Last edited by bgagnon; 09-01-2020 at 11:46 AM. Reason: Added additional info
Reply With Quote