Python: Accessing Windows mapped network drive with known URL, but unknown drive letter

前端 未结 4 1285
南方客
南方客 2021-02-10 07:21

I am trying to write a Python script that can move and copy files on a remote Linux server. However, I can\'t assume that everyone running the script (on Windows) will have mapp

4条回答
  •  攒了一身酷
    2021-02-10 08:08

    If you can reserve a drive letter for this task, and you have the privileges then you can run "net use ..." from python and then use that fixed drive letter to read/write files.

    http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/net_use.mspx?mfr=true

提交回复
热议问题