set i=%time%
if %i:~0,2% gtr 9 goto one
goto end
:one
if %i:~0,2% lss 23 goto two
goto end
:two
call test.exe
:end
……如果时间是早上10点至23点之间就执行特定的程序,不在这时间内继续执行后面的任务。但上面时间实际只能到22点,怎样才能准确点到23点呢?还有这段批处理还能简短一点吗?
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
set i=%time%
if %i:~0,2% gtr 9 goto one
goto end
:one
if %i:~0,2% lss 23 goto two
goto end
:two
call test.exe
:end
……if "%time%" geq "10:00:00.00" if "%time%" lss "23:00:00.00" start "" test.exe