Topic: Python - map widows network drive (Page 1 of 1) |
|
---|---|
Maniac (V) Inmate From: there...no..there..... |
![]() 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..... |
![]() eigh...I figured it out code: path="\\\\server\\share"
|
Maniac (V) Inmate From: there...no..there..... |
![]() 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..... |
![]() nevermind again.... |
Paranoid (IV) Mad Librarian From: ber/ger |
![]() hmm... seems I'm late again. |
Maniac (V) Inmate From: there...no..there..... |
![]() 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 |
![]() 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 |
![]() Hi CPrompt, |
Maniac (V) Inmate From: there...no..there..... |
![]() quote:
|