[英]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.