- @echo off
- title 互助互利,扫码头像,感谢赞助;有什么问题,可加QQ956535081及时沟通
- cd /d "%~dp0"
- set "文件夹1=D:\a"
- set "文件夹2=D:\b"
- set "文件夹3=D:\c"
- for /f "delims=" %%a in ('dir /a-d/b/s "%文件夹1%"') do (
- set "file=%%a"
- set "folder=%%~dpa"
- setlocal enabledelayedexpansion
- set "newfile=!file:%文件夹1%=%文件夹2%!"
- set "newfolder=!folder:%文件夹1%=%文件夹3%!"
- if not exist "!newfile!" (
- echo;"!file!" --^> "!newfolder!"
- xcopy "!file!" "!newfolder!" /q /y
- )
- endlocal
- )
- pause
复制代码
|