回复 5# crownking1983 - @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /ad /b') do (
- pushd "%%i\"
- for /f "delims=" %%a in ('dir /a-d /b') do (
- set name=%%a
- if not exist "!name:~,5!%%~xa" ren "%%a" "!name:~,5!%%~xa"
- )
- popd
- set fname=%%i
- if not exist "!fname:~,5!\" ren "%%i" "!fname:~,5!"
- )
- pause
复制代码
|