回复 8# a0702130270 - @echo off
- :: 全盘查找“b.txt”中列出的目录,并把其下全部文件拷贝到指定目录中。
- set "_S=C:\Users\Administrator\Desktop\猪八戒" ||@REM 自定义保存目录,尾部不要“\”
- set "_F=b.txt" ||@REM 自定义查找的目录列表,不要路径
- for %%A in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do (
- if exist %%A:\ (
- for /f "delims=" %%B in (%_F%) do (
- for /f "delims=" %%C in ('dir /ad/b/s "%%A:\" 2^>NUL') do (
- if /i not "%%~dpC"=="%_S%\" (
- if /i "%%~nxC"=="%%B" (
- for /f "delims=" %%D in ('dir /s/b/a-d "%%C" 2^>NUL') do (
- xcopy /h/y "%%D" "%_S%"
- )
- )
- )
- )
- )
- )
- )
-
- PAUSE
复制代码
|