- @echo off
- for /f "tokens=1* delims= " %%i in ('dir /a-d /b /s') do move "%%i %%j" "%%~i%%~xj"
- set "str=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"
- for /f "delims=" %%i in ('dir /a-d /b /s') do (
- setlocal enabledelayedexpansion
- for %%a in (%str%) do set "[!random!]%%a=%%a"
- for /f "skip=21 tokens=2 delims==" %%a in ('set [') do set "var=!var!%%a"
- ren "%%i" "%%~ni !var!%%~xi"
- endlocal
- )
- pause
复制代码 在第二行加入for /f "tokens=1* delims= " %%i in ('dir /a-d /b /s') do move "%%i %%j" "%%~i%%~xj" |