Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
380 views
in Technique[技术] by (71.8m points)

windows - How to connect to CIFS share mapped to the letter using python?

After I start my laptop and connect to corporate network via VPN I get the environment and all necessary credentials to access network resources. But CIFS share mapped to the drive letter is only connected when I click on it in Windows file explorer. After that I am able to run batch file, which opens several Windows explorer folders on that share. Here is the example of the command from the batch file:

start /min C:Windowsexplorer.exe /n, /e, Z:01data
timeout 3
... next command

Without that extra clicking to the drive the command from the batch file is not capable of opening the folder on the share.

I would like to consider either set Windows command(s) which will connect the drive or create python script to do it. Add one of these solutions to the beginning of the batch file and run all commands together without manual intrusion.

question from:https://stackoverflow.com/questions/65952614/how-to-connect-to-cifs-share-mapped-to-the-letter-using-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...