本帖最后由 Gin_Q 于 2020-4-23 20:53 编辑
- @echo off&setlocal enabledelayedexpansion
-
- for /r %%A in (.) do (
- for /f "tokens=1-4 delims=\" %%a in ("%%A") do (
- if "%%c" NEQ "" (
- if "%%c" NEQ "." (
- set "path_up=%%a\%%b\%%c\"
- set "path_down=%%a\%%b\%%c\%%d\"
- echo %%d | findstr /c:%%c 2>nul 1>nul
- if !errorlevel! EQU 0 (
- echo 正在复制文件夹【!path_down!】下的文件到【!path_up!】
- xcopy /e /y "!path_down!"* "!path_up!"
- if !errorlevel! NEQ 0 (
- echo 复制文件出错!按任意键继续!退出请关闭窗口!&&pause)
- echo 复制完成!
- echo 删除文件夹【!path_down!】
- rd /s /q "!path_down!"
- echo;
- )))))
-
- echo "Done!"
- pause
复制代码
|