我想从源文件复制到目的地只有.txt
扩展名的文件。我想在命令行中给出参数路径名称 - source
和路径名称 - destination
。这里是我的批处理文件Script.bat:批处理文件 - 传递路径名称作为参数在命令行中
@ECHO OFF
setlocal
set /p source =
set /p destination=
FOR %%f IN (*.txt) DO XCOPY "%source%"\"%%f" "%destination%" /m /y /d /s
我要调用此批处理文件在cmd中这样:
cmd> Script.bat "SourceFolder" "DestinationFolder"
但它不工作! 谢谢!
为什么当XCOPY作品'XCOPY下的批处理文件:\源\ *。 txt c:\ dest'或[Robocopy](http://www.computerhope.com/robocopy.htm)'robocopy c:\ hope c:\ hope2 * .txt'? – ziddarth 2015-02-11 20:23:00