0

I have a network drive that requires credentials to map. I'd like to copy all files from that network folder to a local folder using Python 3.5+.

I was successfully using Powershell's

"New-PSDrive -Name "Z" -Root $ip_address -Credential $password -PSProvider "FileSystem" -Persist"

but am trying to switch all my scripts to Python.

I've created a local folder but I'm not sure how to navigate with a network drive.

#Creating destination folder
pathlib.Path(my_target_folder).mkdir(parents=True, exist_ok=True)

I don't even need to map the drives if it's not necessary. Just wanting to copy all files in that directory to my local directory.

  • Check this question, it might be helpful. https://stackoverflow.com/questions/123198/how-do-i-copy-a-file-in-python – Omar Cruz May 14 '19 at 22:12
  • That's interesting but it's unclear how to source from a network drive that requires credentials (e.g. 10.10.10.5 password=1234)... – user2875251 May 14 '19 at 22:29

0 Answers0