@echo off&setlocal EnableDelayedExpansion
set /p choice="请选择:要修改文件名请输入1,恢复请输入2,其他输入会退出程序"
if %choice%==1 goto rename
if %choice%==2 goto back
goto :eof
:rename
if exist name.txt del name.txt
set n=1
for /f %%i in ('dir /b *.jpg') do (echo %%i h00!n!.jpg>>name.txt && set /a n=!n!+1)
for /f "tokens=1,2 delims= " %%i in (name.txt) do (rename %%i %%j)
goto :eof
:back
for /f "tokens=1,2 delims= " %%i in (name.txt) do (rename %%j %%i)
goto :eof
[ Last edited by bigfaint on 2008-3-21 at 03:11 PM ]作者: cad55 时间: 2008-3-21 16:35
Quote:
Originally posted by bigfaint at 2008-3-21 03:10 PM:
试试看,是不是你要的。
@echo off&setlocal EnableDelayedExpansion
set /p choice="请选择:要修改文件名请输入1,恢复请输入2,其他输入会退出程序&quo ...