Python Forum
I'd like to avoid using Net Use - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Networking (https://python-forum.io/forum-12.html)
+--- Thread: I'd like to avoid using Net Use (/thread-32583.html)



I'd like to avoid using Net Use - tester_V - Feb-19-2021

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!


RE: I'd like to avoid using Net Use - Serafim - Feb-19-2021

There are some suggestions (including 'NET USE') on stackoverflow


RE: I'd like to avoid using Net Use - tester_V - Feb-19-2021

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.