Python Forum

Full Version: I'd like to avoid using Net Use
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,
Is there any 'easy way' in Python to mount a drive with credentials without using 'NET USE'?
Or make or make windows remember credentials?
Thank you!
There are some suggestions (including 'NET USE') on stackoverflow
Thank you, I've seen the post before.
I have about 12-35 remote systems to access (need to copy files)and sometimes "Net Use" produces an error and I cannot copy some of the files. Maybe I should increase sleep time? Not sure.
Here is the code I'm using:
    subprocess.call("net use Y: /delete /yes")
    time.sleep(10)
    subprocess.call("net use Y:"+"\\\\"+itm+"\\c$ /user:domain/xxxUSER somepass")
the script copies files but produces this error
Error:
More help is available by typing NET HELPMSG 2250.
System error 67 has occurred.

Thank you.

The network name cannot be found.