- @echo off
- mode con lines=3000
- set info=互助互利,支付宝扫码头像,感谢打赏
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- set "oldfolder=C:\temp"
- set "newfolder=D:\xxx\yyy"
- if not exist "%oldfolder%" (echo;"%oldfolder%" no found&goto end)
- if "%oldfolder:~-1%" equ "\" set "oldfolder=%oldfolder:~,-1%"
- if "%newfolder:~-1%" equ "\" set "newfolder=%newfolder:~,-1%"
- for /f "delims=" %%a in ('dir /a-d/b/s "%oldfolder%\"') do (
- if "%%~xa" equ "" (
- set "oldpath=%%~dpa"&set "oldfile=%%a"
- setlocal enabledelayedexpansion
- set "newpath=!oldpath:%oldfolder%=%newfolder%!"
- if not exist "!newpath!" md "!newpath!"
- echo;"!oldfile!" --^> "!newpath!"
- copy /y "!oldfile!" "!newpath!"
- endlocal
- )
- )
- :end
- echo;%info%
- pause
- exit
复制代码
|