Originally posted by pusofalse at 2008-4-20 03:56 PM:
set /a n+=1
echo. :: %n%>>%~nx0
for /f "tokens=2" %%a in (%~nx0) do set m=%%a
ren %~nx0 已使用(%m%)次%~x0
没试过。。。
[ Last edited by pusofalse on 2008-4-20 at 03:58 PM ]
:: 0
@echo off
set /p n=<%~nx0
call, set n=%n:~2%
set /a n+=1
setlocal enabledelayedexpansion
for /f "delims=" %%i in ('type %~nx0') do (
set /a m+=1
if !m! equ 1 (
echo :: !n!>%~nx0
) else (
endlocal&echo %%i>>%~nx0
)
)
ren %~nx0 已运行%N%次.bat
[ Last edited by zw19750516 on 2008-4-21 at 10:53 AM ]
@echo off
for /f "delims=::" %%i in (%~nx0) do set n=%%i
set /a n+=1
setlocal enabledelayedexpansion
echo :: !n!>>%~nx0
endlocal
ren %~nx0 已运行%N%次.bat
:: 0
[ Last edited by zw19750516 on 2008-4-21 at 11:01 AM ]