Check Internet Connection in HTA via Ping

email me

‘Check Internet Connection
on error resume next
strURL = “www.google.com”
ConnectionTest = WSHShell.Run(“cmd /c ping -n 2 ” & strURL, 0, True)
‘If ConnectionTest = 0 then msgbox “You are connected!”
If ConnectionTest = 1 then
msgbox “This computer is not connected to the network. Please check your connection and try again.”
location.reload()
end if

* remember to instantiate the WSHShell.Run object…