Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Ping status 1

Status
Not open for further replies.

Perilous1

IS-IT--Management
Mar 10, 2005
171
US
I am working with the Ping code provided by Strongm in this post:

Thread

I am wondering however if this code does a standard command-line ping that sends four separate packets. If so, is there a way to check the individual success/failure of each of those four packets.

I am having an issue where occasionally one packet in four fails and the code as it is considers that a failure to ping.

Any help with this would be greatly appreciated.
 
>considers that a failure to ping

Which it is.

However, if you want to emulate the command-line ping, just run it 4 times
 
I should also point out that Win32_PingStatus retrieves a bunch of additional information that may be of interest. The properties can be found here.

And whilst those properties are read only, some can be set in the WMI query in order glean more info. For example, say you were pinging by IP adddress but wanted to resolve that address to a name, you'd change the WMI query line in my original example to something like:
Code:
[blue]Set cPingResults = GetObject("winmgmts:{impersonationLevel=impersonate}//./root/cimv2").ExecQuery("SELECT * FROM Win32_PingStatus WHERE Address = '" + sTarget + "' AND ResolveAddressNames = TRUE")[/blue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top