1

I created a batch file with a timer in it, when it's run a user can enter a time and the batch file will loop until the right time arrives (it will then run a script). This works fine on my own and other computers, however some computers seem to ignore the time given and instantly run the selected script. Any idea as to why this would happen?

@echo off
color 0a
title Initiatie

:a
cls
echo.
echo Select the time in a 24 hour format (00:00:00.00)
echo.
set /p s=

:check
if %s% equ %time% goto b
if %s% neq %time% goto check

:b
cls
start D:\Scripts\testkey.vbs
  • 3
    I suppose the time format on some computers is not `00:00:00.00`. Check [**this**](http://stackoverflow.com/questions/203090/how-to-get-current-datetime-on-windows-command-line-in-a-suitable-format-for-us/19799236#19799236) for getting time independent of the settings. – npocmaka Jan 12 '17 at 12:44
  • 3
    I would not attempt to match the centiseconds. You may end up skipping right over it. – Squashman Jan 12 '17 at 14:58
  • Since you are about to start a vbs it makes much more sense to put that in vbs code as there are date/time variables you can use to compare with greater even. In batch you would have to convert to seconds to be able to compare integers. –  Jan 13 '17 at 00:55

0 Answers0