Dec-21-2017, 06:24 PM
Hi guys,
Using windows, I am trying to use win32wnet module to connect a shared network through a .py file. However, I am not being able to make it work. Has someone used that module to connect shared networks successfully and can point me out on how to do it?
The line not working is the one below the try statement.
Many thanks in advance,
Joan
Using windows, I am trying to use win32wnet module to connect a shared network through a .py file. However, I am not being able to make it work. Has someone used that module to connect shared networks successfully and can point me out on how to do it?
The line not working is the one below the try statement.
Many thanks in advance,
Joan
import os import win32netcon import win32wnet ynetworkPath = '\\\\LAMPSERVER_RB\\resources_server\\' znetworkPath = '\\\\LAMPSERVER\\lampserver\\_PROJECTS\\' yDrive = 'Y:' user = 'a' password = 'b' if (os.path.exists(ynetworkPath)): try: win32wnet.WNetAddConnection2(win32netcon.RESOURCETYPE_DISK, yDrive, ynetworkPath, None, user, password, 0) print "connection working" except: print "Not working" else: print "path not existing" C:\Python27\python.exe D:/pipeline/development/testing_for_network_link.py Not working Process finished with exit code 0