- @echo off
- for /f "delims=" %%a in ('dir /b/a-d "*.*"') do (
- if not "%%~nxa"=="%~nx0" (
- set "more=%%a"&set "mo=%%~na"&set "n=0"&set "ming="
- setlocal enabledelayedexpansion
- call :mo
- ren "!more!" "!ming!%%~xa"
- endlocal
- )
- )
- pause&exit
- :mo
- if not "!mo:~%n%,1!"=="" (
- set "niu=!mo:~%n%,1!"
- call :niu
- set /a "n+=1"
- goto :mo
- )
- goto :eof
- :niu
- for %%b in (a b c d e f g h i j k l m n o p q r s t u v w x y z) do (
- if /i "%niu%"=="%%b" (set "ming=!ming!%niu%"&goto :eof)
- )
复制代码
|