![](/img/trans.png)
[英]Windows Batch: Copy child folders including files to different location
[英]Windows script batch to copy files from different folders to other folders
解釋問題的最簡單方法是舉例。
我想做這樣的事情:
file x in /path_1/A/x copy in /path_2/A/
file x in /path_1/B/x copy in /path_2/B/
...
...
file x in /path_1/Z/x copy in /path_2/Z/
從命令行使用 Windows 中的腳本。
@echo off
cd /path_1
for /D %%d in (*) do (
if exist "%%d/x" (
if not exist "/path_2/%%d" md "/path_2/%%d"
copy "%%d/x" "/path_2/%%d"
)
)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.