king kikapu wrote: > Is anyone see any error in the following code: > > mapDrive = "\\\\MyServer\\C$" > data = {'remote' : mapDrive, 'local' : 'M:', 'password' : > 'mypassword', 'user' : 'Administrator', 'asg_type' : 0} > win32net.NetUseAdd(None, 1, data) > > It gives me "pywintypes.error: (1326, 'NetUseAdd', 'Logon failure: > unknown user name or bad password.')" and i cannot figured out why...I > searched the forum about the syntax of NetUseAdd command and i think > that the syntax is correct and also are the data that i pass to it. > (the same data can give me a connection if i use "net use ..." from a > command line" > > So, what am i doing the wrong way (and keeps me on this the last 2 > hours??...) > > > Thanks for a any enlightenment...
You need to use level 2 info to pass the username. Level 1 is for the old-style share with its own password. Also, it should be 'username': instead of just 'user':. hth Roger ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =---- -- http://mail.python.org/mailman/listinfo/python-list