Basically what I'm trying to create is a script that only will run if the time is LEQ than 19:00 (7 PM), what I did so far is:
set myTime=%time%
set myFlag=false
if %myTime% LEQ 19:00 set myFlag=true
if myFlag=true (
*my script*
)
It returns this error message: "86 was not expected at this moment", (86 being the last numbers of the variable 'myTime' [14:36:11,86]. It just won't work.
I've also tried:
set myTime=%time%
set myFlag=false
if %myTime% LEQ 19:00:00,00 set myFlag=true
if myFlag=true (
*my script*
)
Both ways i get the same error message double-digit number not expected. Any thoughts on how to solve this? It's even possible do a time comparision on a windows batch file?