![](/img/trans.png)
[英]Windows move command not moving the matching file to destination folder using bat
[英]Windows .BAT - Move File
我有以下結構:
/fooFolder
/js
/classes
/interfaces
/ts
/classes
file.js
file.ts
/interfaces
file.js
file.ts
move.bat
我需要使用move.bat文件將文件〜/ ts / classes / file.js移至js / classes ,並將文件〜/ ts / interfaces / file.js移至js / interfaces 。
我嘗試使用下面的代碼:
forfiles /s /m *.js /c "cmd /c move /Y @path %~dp0..\@relpath"
不幸的是,我收到語法錯誤消息。
我的解決方案:
forfiles /s /m *.js /c "cmd /c move /Y @path ..\..\js\@relpath"
作品! 但是...更好嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.