your code line
if %currentTime% geq 07:00 if %currentTime% leq 00:45 set flag=true
compares, as a string, the current time to "07:00" and then to "00:45" and if the current time is later than 07:00 AND earlier than 00:45, performs shutdown -s, otherwise perfoms shutdown -a.
Since a time cannot be both, then it will always follow the else path.
But the code is set up to perform shutdown regardless, so it can't "do nothing" as you claim.
Perhaps you want to shutdown before 07:00 but with different paramaters if it's before 00:45
if %currentTime% lss 07:00 (
if %currentTime% leq 00:45 (
shutdown -s
) else (
shutdown -a
)
)
That is shutdown -s before 00:45 and shutdown -a if later than 00:45 but before 07:00
Your next problem is that you don't tell us which tme-formt you use. It's possible to use 24-hour time or 12-hour time and it's possible to use a leading "0" on the hours, or replace that leading 0 with a Space
Without knowing what format you use, there are four possibilities for conversion or comparison. The above should work with 24-hour, leading 0's.
if %time::=% geq 004500.00 if %time::=% leq 070000.00 set flag=true