What is the best way to map a network share to a windows drive using Python? This share also requires a username and password.
I don't have a server to test with here at home, but maybe you could simply use the standard library's subprocess module to execute the appropriate NET USE command?
Looking at NET HELP USE from a windows command prompt, looks like you should be able to enter both the password and user id in the net use command to map the drive.
A quick test in the interpreter of a bare net use command w/o the mapping stuff:
>>> import subprocess
>>> subprocess.check_call(['net', 'use'])
New connections will be remembered.
There are no entries in the list.
0
>>>