0

I'm using a .bat file to get some files from a shared folder on another computer in the same network. My challenge is that the shared folder is password protected. Is there a way to write username and password in a batch file when getting files from a shared folder located on another computer?

@echo off
Move /Y \\path\to\files\*.csv \\path\to\local\folder\
pause

1 Answer 1

1
@echo off
net use X: \\path\to\files\ /user:<username> <password>
move /y x:\*.csv \\path\to\local\folder\
net use x: /d
pause
1
  • Thanks a lot. It works perfect. the only thing i need to modify is to remove the last \ from \\path\to\files\, otherwise I got "system error 67 has occurred".
    – Zhenyu
    Sep 8, 2014 at 12:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .