
CODE: [Copy to clipboard]代码 2:@echo off
for %%a in (*.txt) do call :ren "%%a"
exit
:ren
for /f "tokens=*" %%a in (%~s1) do (
ren %1 "%%a.txt"
goto :eof
)
CODE: [Copy to clipboard][ Last edited by tireless on 2009-2-11 at 18:39 ]@echo off
setlocal enabledelayedexpansion
for %%a in (*.txt) do (
set /p new=<"%%a"
ren "%%a" "!new!.txt"
)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |