上次来的时候,有人问怎么让一个程序,在设定的时间后运行,今天我写了一个,发上来,大家一起改进。
[ Last edited by scriptor on 2007-9-14 at 04:07 PM ]
@echo off
:lp
cls
echo.
setlocal enabledelayedexpansion
echo The time now is: %time%
echo.
set si=%time%
echo Press any key to see the result.....
pause >nul
::Select var
set th=!si:~0,2!
rem select hour
set tm=!si:~3,2!
rem select minute
set ts=!si:~6,2!
rem select second
set tms=!si:~9,2!
rem select milisecond
:: add one minute to origin.
::这里,你可以自己设定隔多久运行某个程序
set /a tm%+=1
::Check output
if "%tm%" equ "60" (set /a th%+=1)
::如果大于60分钟,就将小时数加一
echo.
echo The latest time is: %th%:%tm%:%ts%
echo Attention,the xxx program will run at this time!
pause>nul
goto :lp
[ Last edited by scriptor on 2007-9-14 at 04:07 PM ]

