Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Not recognizing network path

Status
Not open for further replies.

Aarem

Programmer
Oct 11, 2004
69
US
Hi, I have a python script that is supposed to check to see if a computer exists on a windows network, but python always seems to return false:

os.path.isdir("\\\\MyPCNetworkname\\")

should work, right? for some reason, if i have a trailing folder (like \\MyPCNetworkname\folderhere), then it returns true (if it exists). But not every computer the user enters is going to have a folder. Any ideas?

Thanks!
 
my understanding, emphasis on the my, is that network shares are in the format
\\<computername>\<sharename>
for example, on my desktop, I have the following shares
SpringerIN
SpringerOUT
which others on our network access as
\\sp0234\SpringerIN
and
\\sp0234\SpringerOUT
I also have the following default shares
\\sp0234\C$
\\sp0234\D$
which allow, depending on permissions, access to the roots of my drives C: and D:
 
Yes, that is the format I used. (the slashes are escaped.)

"\\\\MyPCNetworkname\\"

becomes

\\MyPCNetworkname\
 
Basically, I just need something that will allow me to access directory listings of other computers on the network.
 
So there's no way to just tell if a computer exists without having a shared folder under it?
 
well you could ping it and see if it responds
although some machines on our network do not repond to pings
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top