How To Ping in VBScript

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