Well, I have this problem with a little program that I'm making because my loop is endless. Right now I'm trying to use goto command but it doesn't work couse it is endless. Anyone please help.
@echo off
color 1a
:i
echo Hi, mate Let's start off by getting each others names.
timeout 5 > nul
echo What is your name ?:
set /p name=
echo Hi noob %name% my name is Youke
timeout 2 > nul
echo %name% We are going on an advenutre quest today :D
timeout 2 > nul
goto i
Somewhere between the i
label on line 3 and the goto
command, you need to add code that will break out of the loop—likely an if
statement with another goto
inside it that points to a label after your current goto
.
You can see plenty of examples here: https://stackoverflow.com/a/4711984/436282