I have a script to divide the hour into two periods, from 10-21 set not run, the rest set run as below:
Code: Select all
SET hour=%time:~0,2%
echo %hour%
IF %hour% leq 21 (
IF %hour% geq 10 (
SET shouldrun=False
echo 1
) else (
SET shouldrun=True
echo 2
)
) else (
set shouldrun=True
echo 3
)
if "%shouldrun%" == "True" goto to_run
if "%shouldrun%" == "False" goto not_run
:to_run
echo run
goto end
:not_run
echo not run
:end
I know hour from time usually 24 format. please correct me if I am wrong.
Any idea?