I've nearly completed an HTA that uses the Win32_PingStatus to verify if a
computer is up and running. If so it uses additional WMI to gather the
computer name, logged on user and domain. Once that's is done it offers 4
options - Computer Management, Remote Assistance, Remote Desktop and
connecting to c$. Very nice and almost done if it weren't for Vista.

The code below (with the On Error disabled) errors at "For" with "Could not
completed the operation due to error 80041001" but only when a number is
enter that is smaller than 1677216 (which equates to 0.255.255.255. If the
number enter is 1677216 (which equates to 1.0.0.0) then it will work
properly. The problem is that it will work properly with both computer names
and IP addresses and it is possible to name a computer, 45. I've tried
checking the valued entered for a "." to make sure it's not an IP address and
then using CStr so Vista won't treat it as number. This still doesn't work!

Any ideas how to circumvent this problem? By the way, the onload checks the
versions of Windows so I have the option to code using that and in some other
places I do.

-----------------------------------
Set objPing =
GetObject("winmgmts:{impersonationLevel=impersonate}").ExecQuery _
("select * from Win32_PingStatus where address = '" & strCPU & "'")

'On Error Resume Next
For Each objStatus in objPing...
-----------------------------------

Re: Win32_PingStatus on Vista (works on XP) by Franz_aRTiglio

Franz_aRTiglio
Tue May 06 05:06:15 CDT 2008

DhamAngry wrote:

> "Could not completed the operation due to error 80041001" but only
> when a number is enter that is smaller than 1677216 (which equates to
> 0.255.255.255. If the number enter is 1677216 (which equates to
> 1.0.0.0) then it will work properly.

AFAIK an IP starting with 0 is NOT a valid IP.

so 0.x.x.x is INVALID, 1.x.x.x to 254.0.0.254 is valid.