dimanche 22 décembre 2019

How to use the timeout command in batch language?

I actually wanted to create a timer using batch program and when I run the code the output is not the way I want. The screen continues flicking without decreasing the second. Can someone Help me. Thanks alot.

@echo off
set countdown=10
:loop
if %countdown% == 0 goto end
cls
echo %countdown% 
timeout /t 1 /NOBREAK
set/a count=%countdown%-1
goto loop
:end
cls
echo Time's up!
pause

Aucun commentaire:

Enregistrer un commentaire