I've borrowed the great code here:
*Credits to Mr. Ryan Farley
If possible though, I'd like to change the default behaviour of this script. Each server that gets tested opens a quick command window for the test and just as fast as the test is done - it goes away.
Is there an option to run a script such as this, where there isn't any console/cmd window displayed?
On Error Resume Next
Set shell = CreateObject("WScript.Shell")
' Send 1 echo request, waiting 2 seconds for result
Set exec = shell.Exec("ping -n 1 -w 2000 " & Target)
results = LCase(exec.StdOut.ReadAll)
Ping = (InStr(results, "reply from") > 0)
If Ping("192.168.1.100") Then
' Do something to access the resource