我想從源文件複製到目的地只有.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