win32net.NetUseAdd syntax, possible bug

Roger Upole rupole at
Mon Apr 21 09:39:58 CEST 2003

Both of the levels of info for the function use 'password' spelled out.
Looks like you want level 2 info, user is not included in level 1. (key is
You'll probably also have to pass the 'domainname' for level 2 also.

"Scott Prive" <scottprive at> wrote in message
news:mailman.1050496946.25294.python-list at
> Hello,
> I'm attempting to use win32net.NetUseAdd, had a problem and I think
> a bug in the API, or the docs (or me! :-)
> The ActiveState made it clear most of the properties need to be in a
> dictionary. It lacked an example use, but referred me to the MSDN site,
> at MSDN could see there the data structure. In theory I should combine the
> two docs and know all the things I can pass into the call via dictionary.
> Small problem: the MSDN data structure calls the PW key "password", and
> win32net.NetUseAdd does not understand this. It looks like the function
> needs a key called "passwd", and if not provided it falls upon some
> value (or the current credentials), making it appear that your user/pass
> values are not valid on the server when in fact they were.
> This is my first post to the list (cc: me, I'm not subscribed). Is this
> appropriate place for possible bug reports? How do I determine a module's
> "owner", and should I mail them directly?
> The code looks like:
>     import win32net
>     data = {}
>     data['remote'] = r'\\\myshare'
>     data['local'] = 'Z:'
>     data['password'] = 'foo' #Hmm.. I should call this     data['passwd']
> 'foo'
>     data['user'] = 'foo'
>     data['asg_type'] = 0
>     win32net.NetUseAdd(None,1,data)
> -Scott

-----------== Posted via Newsfeed.Com - Uncensored Usenet News ==----------       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----

More information about the Python-list mailing list