繁体   English   中英

Windows脚本批处理将文件从不同文件夹复制到其他文件夹

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM