
CODE: [Copy to clipboard]或者开启变量延迟:@echo off
for /f "delims=" %%i in ('dir /s /b c:\*bb.txt') do call :lp "%%i"
pause&goto :eof
:lp
set str=%~nx1
set str=%str:bb=cc%
ren %1 %str%
goto :eof
CODE: [Copy to clipboard][ Last edited by zw19750516 on 2008-4-17 at 11:48 AM ]@echo off
for /f "delims=" %%i in ('dir /s /b c:\*bb.txt') do (
set str=%%~nxi
setlocal enabledelayedexpansion
set str=!str:bb=cc!
ren "%%i" !str!
endlocal
)
pause
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |