[英]MS DOS command or Java code to Copy a file are directory from one drive to Multiple Drives?
I need to copy a directory from one directory to multiple drives (the drives are external storage devices). 我需要将一个目录从一个目录复制到多个驱动器(这些驱动器是外部存储设备)。 After searching I found the MS DOS command
xcopy C:\\ F:\\ /e
. 搜索后,我发现了MS DOS命令
xcopy C:\\ F:\\ /e
。 This command only copies a file to one drive at a time, it doesn't copy to multiple drives. 此命令一次只能将文件复制到一个驱动器,而不能复制到多个驱动器。 Is there any way to copy a file from one drive to many drives?
有什么方法可以将文件从一个驱动器复制到多个驱动器吗?
A small batch file may help to achieve what you need. 一个小的批处理文件可能会帮助您实现所需的功能。
set src=%~1
:Loop
shift
set dest=%~1
if "%dest%"=="" goto :EOF
xcopy "%src%" "%dest%" /E
goto Loop
save the code to %SystemRoot%\\system32\\mcopy.bat
, then mcopy some-file e: f:\\some-directory g:\\some-directory-2 h: i:
... 将代码保存到
%SystemRoot%\\system32\\mcopy.bat
,然后mcopy some-file e: f:\\some-directory g:\\some-directory-2 h: i:
...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.