Copying files to file server

Mark Hammond mhammond at skippinet.com.au
Fri Dec 10 07:29:14 EST 1999


Tomaz Ficko wrote in message ...

>I want to login on the network and map remote dir to local dir. Here is
what
>I tried with win32wnet:
>
>>>> import win32wnet
>>>> from winnetwk import *
>>>>
>win32wnet.WNetAddConnection2(RESOURCETYPE_DISK,'e:/','\\\\mars\\tehnolog\\f
i
>cko','','username','password')
>Traceback (innermost last):
>  File "<pyshell#6>", line 1, in ?
>
>win32wnet.WNetAddConnection2(RESOURCETYPE_DISK,'e:/','\\\\mars\\tehnolog\\f
i
>cko','','username','password')
>api_error: (0, 'WNetAddConnection2', 'No error message is available')

Hrm.  Actually, WNetAddConnection2 has a buglet in that when it fails, it
doesnt pass the correct error code - hence the zero and "No error..." for
the error info.

So, it appears the function failed, but we dont know why :-(  When I try it
with a fixed version I get error number 50 - "The network request is not
supported"

The SDK documentation for this function states that for the password and
username params: "Windows 95/98: This parameter must be NULL or an empty
string."

Looking up MSDN offers the following knowledge base articles that may apply:
Q173011 : INFO: WNetAddConnection2 and Multiple User Credentials
Q218497 : INFO: User Authentication Issues with ADSI WinNT Provider

The news isnt too good - although vague, they pretty much say "dont be
surprised if it doesnt work on Windows 95" - and given the comment about the
username/password on 95/98, Im not surprised why :-)


>the server (backup) and disconnect from server. Is that possible with
Python
>from Windows 95.

If you can work out how to do it in _any_ language, Python will be able to
too :-)  Im afraid I can't...

Mark.






More information about the Python-list mailing list