Topic: Python - map widows network drive (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
posted 11-20-2008 01:46
Not sure where to post this so... code: import win32wnet from win32netcon import RESOURCETYPE_DISK as DISK drive_letter = "K:" path = "\\server\share" win32wnet.WNetAddConnection2(DISK, drive_letter, path)
quote:
|
Maniac (V) Inmate From: there...no..there..... |
posted 11-20-2008 01:52
eigh...I figured it out code: path="\\\\server\\share"
|
Maniac (V) Inmate From: there...no..there..... |
posted 11-20-2008 16:14
OK...how can I suppress the pywintypes errors? quote:
code: try: win32wnet.WNetAddConnection2(DISK,scans_drive,scans_path) except pywintypes.error,details: err_code=details[0] print "Error"
quote:
|
Maniac (V) Inmate From: there...no..there..... |
posted 11-20-2008 16:28
nevermind again.... |
Paranoid (IV) Mad Librarian From: ber/ger |
posted 11-20-2008 20:29
hmm... seems I'm late again. |
Maniac (V) Inmate From: there...no..there..... |
posted 11-21-2008 14:08
no problem. I'm glad I figured it out on my own though. Another 14 minutes and I wouldn't have had to post that last question |
Paranoid (IV) Inmate From: A graveyard of dreams |
posted 11-21-2008 15:39
I think your first problem with the extra slashes would have been solved by using Python's raw string syntax: code: path = r"\\server\share"
|
Maniac (V) Inmate From: Lebanon |
posted 11-22-2008 00:32
Hi CPrompt, |
Maniac (V) Inmate From: there...no..there..... |
posted 11-22-2008 03:18
quote:
|