Python Forum
I'd like to avoid using Net Use
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'd like to avoid using Net Use
#1
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!
Reply
#2
There are some suggestions (including 'NET USE') on stackoverflow
Reply
#3
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.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020