简体   繁体   中英

require a batch file to copy from network drive to my local system

I have a network drive as diwakar(\\192.168.204.45) . i want to copy files from this network drive to c:\\users\\ How to write a batch file for this work.

Try this - it is designed to map the drive using your credentials and then robocopy can mirror the drive to the "c:\\users\\peter\\network drive" folder.

Be careful: Mirroring is a very powerful tool which will delete files if you aren't careful with the target folder name.

@echo off
net use z: "\\192.168.204.45\share" /user:yourname
if exist "z:\" robocopy "z:\" "c:\users\peter\network drive" /mir

解决方案是:xcopy / e \\ 192.168.204.45 \\ diwakar *。*“c:\\ users \\”它将复制共享驱动器中存在的所有内容并移动到目标文件夹中。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM