I am trying to create a countdown timer that is in min
:sec
format which uses a variable taken from a text document and uses it as the finish time and uses the current time (time the .bat
was started) as the start time.
Currently I have this code which works and gets the time from the text document but I can't seem to figure out how to use get it to work.
Code:
@echo off
set CurrentTime=%time:~0,2%.%time:~3,2%
set /p StartTime=<"ResponseTime.txt"
echo.
echo %CurrentTime% %StartTIme%
echo.
What I would do is create a
timeout
function such astimeout /t xx
where xx equals the time in seconds. If that is what you're looking for.You can also do
timeout /t xx >nul
so that it won't display a message saying how many seconds you have left. If that is what you want then use the first one I showed. I hope this helpedWorks perfect
timeout /t 10>NUL start chrome "https://google.com"