I'm currently attempting to write a batch file in DOS that will open a program when the interal clock hits a certain time.
This is what I have so far:
VER | TIME > TEMP.BAT
ECHO SET TIME=%%3>CURRENT.BAT
ECHO It's now %TIME%
IF %TIME%=="10:33:00.00a" START c:/myprog.exe GOTO END
If you're familiar with the TIME command, you know what my problem is. The loop is working perfectly and comparing the time to the string I specify, but the time it takes to execute the loop is not a perfect second. The clock never reaches 10:30:00.00a, but it does hit 10:30:00.01a, 10:30:01.03a, etc. Presumably, if I ran this batch file at precisely the right time, the interal clock would hit 00.00 and the program would spawn, but that's impossible to count on.
I'm new to batch file programming, and I know what I need to do is extract the hour and minute parts of the time command and compare them, but I'm at a loss as how to do this. Previously, I attempted to use wildcard characters in my compare string for the second arguments, but that did not work either.
Can anyone help?