Re: Online Test
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 05/09/04
- Next message: Russ_S-K: "Patch Installation Notice"
- Previous message: Al Dunbar [MS-MVP]: "Re: Online Test"
- In reply to: Al Dunbar [MS-MVP]: "Re: Online Test"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 10 May 2004 00:18:56 +0200
Al Dunbar [MS-MVP] wrote:
> "Russ_S-K" <anonymous@discussions.microsoft.com> wrote in message
> news:4E960996-C198-477C-931A-0D42E87E4BB9@microsoft.com...
>
>>I was wondering if there is a better test to determine if a PC is online
>
> than the one I am using. Using ping seem to be a rather crude way. Here is
> the code I use:
>
>>iPing = oShell.Run( "cmd /c ping -n 2 -w 50 " & sComputer & _
>>" | find /i ""Reply from"" ", 0, TRUE )
>>If iPing <> 0 Then
>> wScript.Echo sComputer & " is not currently online."
>>End If
>
>
> Almost any method for communicating with a remote computer is going to have
> some issues when the remote computer fails to respond, resulting in even
> more time wasted than waiting for ping responses to time out.
>
> You could write a WMI script, for example. But the nature of the
> communications involved in that scenario is more detailed than a ping, and
> relies more heavily on processing being done by the remote system. I have
> not timed it myself, but I would be surprised if it takes less time for a
> WMI script to determine that a system is not there.
Hi
Using WMI to check if a system is alive is not a good solution (unless
you use the Win32_PingStatus method introduced with WinXP that pings a
computer). WMI uses several minutes to timeout when trying to connect
to an unavailable computer.
-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/community/scriptcenter/default.mspx
- Next message: Russ_S-K: "Patch Installation Notice"
- Previous message: Al Dunbar [MS-MVP]: "Re: Online Test"
- In reply to: Al Dunbar [MS-MVP]: "Re: Online Test"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|