- @echo off
- set /p "src=请输入源文件夹地址:"
- set "s=%src:"=%"
- if "%s:~-1,1%" == "\" set "s=%s:~0,-1%"
- for /r "%s%" %%i in (*.*) do (
- echo "%%~nxi"|find "%%" >nul && (
- set "t=%%i"
- set "n=%%~nxi"
- call:e
- )
- )
- pause
-
-
-
- for /f "delims=" %%i in ('dir "%s%" /b /ad /s^|sort /r /+300') do (
- echo "%%~nxi"|find "%%" >nul && (
- set "t=%%i"
- set "n=%%~nxi"
- call:e
- )
- )
- pause & exit
- :e
- setlocal enabledelayedexpansion
- set m=!n:%%=#!
- echo 重命名"!t!"
- ren "!t!" "!m!"
- endlocal
复制代码
|