[pywin32] windows shares, was os.listdir("\\\\delta\\public")

Peter Hansen peter at engcorp.com
Mon Dec 6 15:13:30 CET 2004

Egor Bolonev wrote:
>> Try grabbing the output of os.popen(r"net view \\delta") and
>> parse it to get a list of the shares:
>> c:\>net view \\monolith
>> No doubt you can also do this much more easily with the pywin32
>> package, or via COM (using pywin32 or ctypes), but I'll leave
>> that response to someone else.  Or you could figure it out yourself
>> if you are motivated enough.
> how to get list of shares using pywin32?

Apparently you weren't motivated enough...

This is not a Python question.  It's a Windows API question.
Go find the appropriate Windows API and you'll pretty much
have your answer.  There are tools called Google and
comp.os.windows* and such that would be of great help (in
conjunction with a little initiative).

*Then*, and only then, if you can't get it working but have
tried, is it really appropriate to ask here in the Python
forum how to do it.  Your question at the time would say something
like "I'm trying to use the WinGetNetworkSharesA() call to
retrieve a list of shares but this isn't working... see the
following traceback for details.  Thanks in advance for your help."

Or you can still just ask here for someone to do the work
for you.  That does often work, strangely enough.

(It's possible that the problem stems from a language issue.
If your English is such that you are finding it very difficult
to understand our responses, or to ask a more detailed question,
then my apologies for thinking you were rude.  It might help
you to say that this is the problem and then you might get
more direct help.)


More information about the Python-list mailing list