I tend to run a lot of commands against remote PCs, but I always check to make sure they are online first. I currently use this code:
If objFSO.FolderExists("\\" & strHost & "\c$") Then
'The PC is online so do your thing
However, when the remote PC is not online, it takes my laptop ~45 seconds before it times out and resolves to FALSE
.
Is there a way to hasten the timeout? Or is there another easily implementable solution to determine if a PC is online?
You could use
WMI
to ping it.You can use the return code from a ping request: