Sign in to follow this  
Followers 0
cyberal

drivestatus question

8 posts in this topic

It there some special way to use "drivestatus" to determine if a network connected PC or Laptop is on and connected? I tried Local $status = drivestatus("\\MarDellLaptop") which doesn't seem to work. Local $status = drivestatus("G:\") for a locally connected USB external drive does work just fine. Naturally, I just assumed the \\marDellLaptop would work.

Thanks for any help

Cyberal


Yah, I'm an old fart, but what the hey, still enjoy keeping busy

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You can always Ping it:

$bSuccess = ping("marDellLaptop")

msgbox ( 4096, "Ping", $bSuccess )

Unless it really is mapped to a drive on your comp, then there are other options...or you can event attempt to map to an open drive, and see if success/failure to determine.

Edited by jdelaney

IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.

Share this post


Link to post
Share on other sites

The ping does work but I am getting different results. Sometimes it tells me they are there (PC and Laptop) and other times their not there. Both of them are on and connected. I guess that is not to dependable. I used a timeout of 10000.

I'm a newbe and am not sure how to do you other suggestions.

cyberal


Yah, I'm an old fart, but what the hey, still enjoy keeping busy

Share this post


Link to post
Share on other sites

The ping does work but I am getting different results.

Are you aware that the ping gives you different numbers each time you ping. 0 means they are not connected and other numbers mean they are connected.

Share this post


Link to post
Share on other sites

Yes, I am getting 0 sometimes and a number other times. Go figure ?????

cyberal


Yah, I'm an old fart, but what the hey, still enjoy keeping busy

Share this post


Link to post
Share on other sites

First off, and more concerning, you need to identify why you are getting unreliable ping responses.

Are you working on a domain?

Most important - What name resolution method is being used?

Is the machine you are pinging them from getting refreshed (DNS cache, WINS cache, arp cache)

If you ping the machines manually do they always respond (If they do, I have found:

$test = RunWait(@ComSpec & " /c ping computername")
to be much more reliable than Ping() , which has given me some strange responses in the past when used across different segments of a network

[font='Comic Sans MS']Eagles may soar high but weasels dont get sucked into jet engines[/font]

Share this post


Link to post
Share on other sites

ShornW,

Again newbee here. I do have wireless network and my HP printer is wireless and my wife's desktop is also. The laptop is a direct connect to my router/modem via coax connection as is my own desktop PC. I am using the computer name to test both the laptop( mardelllaptop) and my wife's desktop (marpc). That's just not working reliably which you mentioned. I am going to try your new method shortly.

I also am trying to test for the existance of a unique folder name on her desktop and shared that folder ("DoNotDelete" is the folder name)

if FileExists("mardelllaptopDoNotDelete") then

msgbox(0,"Does it exist","Mardelllaptop does Exists")

Else

msgbox(0,"Does it exist","mardelllaptop Does not exist")

EndIf

exit

This seems to be working every time

I'll let you know how I make out on these solutions...

Thanks for all your help

cyberal


Yah, I'm an old fart, but what the hey, still enjoy keeping busy

Share this post


Link to post
Share on other sites

ShornW,

Sorry for not getting back to you sooner.

The "RunWait" doesn't seem to be very reiliable either. The test for a folder existing does seem to be pretty reliable. Time will tell for sure.

I truely appreciate your help!

cyberal


Yah, I'm an old fart, but what the hey, still enjoy keeping busy

Share this post


Link to post
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
Sign in to follow this  
Followers 0