Jump to content

Quickly detect if a remote computer is on


 Share

Recommended Posts

I've been doing the following:

If ping($ComputerName,5) > 0 Then
    ;Computer is on
EndIf

But this method is pretty slow, even with the timeout set to 5ms. I'm wondering if anyone else has a better, faster method for detecting if a remote computer is powered on?

Link to comment
Share on other sites

I've been doing the following:

If ping($ComputerName,5) > 0 Then
    ;Computer is on
EndIf

But this method is pretty slow, even with the timeout set to 5ms. I'm wondering if anyone else has a better, faster method for detecting if a remote computer is powered on?

If it's slow because you frequently check then maybe my udf will help because it runs another task to check that an ip is available, and it can do any combination of

set a flag for the state of connection,

set an icon for ON or OFF

call an 'event' function when the state of connection of an ip changes.

It was designed for checking lots of ips (I know someone uses it for more than 30) without slowing the main script, but even one ip would have a time saving.

See my sig.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Thanks I'll definitely take a look.

What bothers me is that if I ping a machine that is on the network the response time is between 3 and 5 ms, but if I ping a machine that is off it takes around 500ms, even though I have the timeout on the ping set to 10ms. It seems the timeout isn't working correctly. Ping is only slow when the machines are off. In my mind it should timeout after 10ms and move on but that isn't happening.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...