Differences
This shows you the differences between two versions of the page.
— |
howto:how_to_ping_in_vbscript [2012/07/03 20:44] (current) smark created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== How To Ping in VBScript ====== | ||
+ | ====== Code ====== | ||
+ | |||
+ | <code>Set WshShell = CreateObject("WScript.Shell") | ||
+ | PINGFlag = Not CBool(WshShell.run("ping -n 1 hostname",0,True)) | ||
+ | If PINGFlag = True Then | ||
+ | MsgBox "Ping Successful" | ||
+ | Else | ||
+ | MsgBox "Ping Unsuccessful" | ||
+ | End If</code> |