I need to copy a directory from one directory to multiple drives (the drives are external storage dev开发者_开发技巧ices). After searching I found the MS DOS command 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:
...
精彩评论