0

How do I open Windows share with credentials using Python on a Windows machine?

I'm currently doing this:

share = open(r'share@username:password','r')
kefir500
  • 4,184
  • 6
  • 42
  • 48
sach20
  • 45
  • 1
  • 5

1 Answers1

0

i used

subprocess.call(r'net use z: \windows_server\share /user:@username password', shell=True) to mount the share and

subprocess.call(r'net use z: /delete')

to delete it.This is the most hassle free and efficient way. Thanks everyone for the help!!

sach20
  • 45
  • 1
  • 5