Copying files to file server

Tomaz Ficko tomaz.ficko at agroruse.si
Fri Dec 10 04:39:47 EST 1999


Mark Hammond wrote in message
<5_V34.3331$Cl3.17409 at news-server.bigpond.net.au>...
>You can specify the file name with the UNC syntax:
>
>f = open(r"\\server\sharename\dir\filename.txt")
>
>Why didnt win32wnet work?  What did you try and do?  Are you sure you have
>access to the share name - eg, can you type "dir \\server\sharename\dir"
>from a command prompt?
>
>Mark.
>
>

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\\fi
cko','','username','password')
Traceback (innermost last):
  File "<pyshell#6>", line 1, in ?

win32wnet.WNetAddConnection2(RESOURCETYPE_DISK,'e:/','\\\\mars\\tehnolog\\fi
cko','','username','password')
api_error: (0, 'WNetAddConnection2', 'No error message is available')

I want to write a script that will login on the network, copy the files to
the server (backup) and disconnect from server. Is that possible with Python
from Windows 95.


Tom





More information about the Python-list mailing list