win32net.NetUseAdd syntax, possible bug

Roger Upole rupole at hotmail.com
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
'username')
You'll probably also have to pass the 'domainname' for level 2 also.
   HTH
      Roger




"Scott Prive" <scottprive at earthlink.net> wrote in message
news:mailman.1050496946.25294.python-list at python.org...
> Hello,
>
> I'm attempting to use win32net.NetUseAdd, had a problem and I think
there's
> 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,
and
> 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
default
> 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
the
> 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'\\mypdc.example.com\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 ==----------
   http://www.newsfeed.com       The #1 Newsgroup Service in the World!
-----= Over 100,000 Newsgroups - Unlimited Fast Downloads - 19 Servers =-----




More information about the Python-list mailing list