日期:2014-05-17 浏览次数:20821 次
@echo off
setlocal EnableDelayedExpansion
for /r H:\path_x\ %%i in (*.*) do (
set s=%%i
set n=%%~nxi
set b=!n:~0,3!
set c=!n:~3!
if "!b!"=="abc" (
rename !s! abd!c!
)
)
PAUSE
@echo off
setlocal EnableDelayedExpansion
for /r "H:\path_x\" %%i in (abc*) do (
set "nameOld=%%~nxi"
set "nameNew=abd!nameOld:~3!"
ren "%%i" !nameNew!
)
pause