复制代码
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir/a-d/s/b/l/on "e:\111\*.txt"') do (
- if /i "%%~nxi"=="good.txt" (
- set "name_dp=%%~dpi"
- set "name_dp=!name_dp:e:\111\=d:\222\!"
- xcopy/y "%%i" "!name_dp!"
- )
- )
- for /f "delims=" %%i in ('dir/a-d/s/b/l/on "e:\111\*.txt"') do (
- if /i "%%~nxi"=="good.txt" (
- xcopy/y "%%i" "d:\%%~pi"
- )
- )
- ren "d:\111" "222"
- pause
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |