Win32 drive mapping... aka "net use"

Mark Hammond MarkH at ActiveState.com
Sat Jul 29 02:32:56 EDT 2000


> > and I own "Python Programming on Win32". I find it very useful. The
> example
> > below (including NetUseAdd) is not addressed in "Python Programming on
> Win32".
>
> Not exactly, no.  I do think its omission is a bug in Appendix B.

Actually, Appendix B is only supposed to address the API functions
discussed in the book.  Otherwise it would be too large.

Also, FYI:  win32net does not work on Win9x.  There is a module named
win32wnet which does, and also provides other useful Netbios etc
functions.  However, this doesnt have any documentation in the help files
(which makes it pretty useless).  Im going to fix this now.

There is a function WNetAddConnection2 - example usage is:

win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_DISK, "Z:",
"\\\\brat\\c", None, None, None)

The params are:
       Integer Type,  // RESOURCETYPE_DISK, RESOURCETYPE_PRINT, or
RESOURCETYPE_ANY
       String LocalName, // String or None
       String RemoteName, // String (required to be in network format
       String ProviderName,// String or None
       String Username,
       String Password)

Mark.






More information about the Python-list mailing list