listing network shares with python

Posted by Gearoid Murphy on Stack Overflow See other posts from Stack Overflow or by Gearoid Murphy
Published on 2009-09-22T11:46:33Z Indexed on 2010/04/26 18:33 UTC
Read the original article Hit count: 207

Filed under:
|
|

Hello, if I explicitly attempt to list the contents of a shared directory on a remote host using python on a windows machine, the operation succeeds, for example, the following snippet works fine:

os.listdir("\\\\remotehost\\share")

However, if I attempt to list the network drives/directories available on the remote host, python fails, an example of which is shown in the following code snippet:

os.listdir("\\\\remotehost")

Is anyone aware of why this doesn't work?, any help/workaround is appreciated.

© Stack Overflow or respective owner

Related posts about python

Related posts about network