Is it possible to check if the time is in between two ranges and then perform an action based on it.
For eg: I want to perform an action only when the current time is not in between 11.00 PM and 6.00 A.M.
Here's what I have so far but I am unable to pin the in between part.
set "currentTime=!TIME::=!"
set "currentTime=!currentTime:,=!"
set "_bit_compare=leq"
set "compareTime=2300"
set "compareTime1=600"
(time /t | findstr /l "AM PM" || set "_bit_compare=gtr")>nul
if "!currentTime:~0,4=!" %_bit_compare% "!compareTime!" (
do somethinf
)