未测试:- @echo off
- set var=0123456789abcdefghijklmnopqrstuvwxyz
- for /f "delims=" %%a in ('dir /b /a-d') do (
- setlocal enabledelayedexpansion
- set filename=%%~na
- set filename=!filename:~,6!
- if not "%%a"=="%~nx0" (
- for /l %%i in (1,1,4) do (
- set /a num=!random!%%36
- for %%j in (!num!) do set str=!str!!var:~%%j,1!
- )
- ren "%%a" "!str!!filename!%%~xa"
- )
- endlocal
- )
- pause
复制代码
|