Win32 drive mapping... aka "net use"

Roger Upole rupole at
Sat Mar 5 20:22:14 CET 2005

You could use win32api.GetLogicalDriveStrings to list
the drive letters currently in use, and find the next free
letter.  net use * probably does something like that under
the covers.


"Lucas Machado" <LMachado1 at> wrote in message 
news:1110044817.235507.299580 at
> Alex Martelli wrote:
>> import win32net
>> win32net.NetUseAdd(None,1,{'remote':r'\\server\share','local':'K:'})
>> is an example (not all that easy to fathom from the docs, but I
>> found it out with a little help from the docs, a little from MSDN,
>> and a little experimentation).
> I looked through the MSDN and was not able to find much information on
> how to properly use the NetUseAdd function.  I searched for the
> function and looked through the results but all it showed was some data
> structure, but i was actually looking for a list of all possible
> arguments and which arguments were/were not required.
> my problem with the above NetUseAdd example is that I would rather not
> have to specify a device.  In the script I am writing the user may
> choose to map multiple shares so I need to be able to map to the next
> available device:
> net use * \\some_server\share_name
> instead of:
> net use k: \\server\share
> Thanks for the help in advance.  Also, if anyone could provide a link
> to good windows api docs for python that would be great.
> Cheers,
> --Lucas Machado

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

More information about the Python-list mailing list