I'm coding a program in Batch and recently I stumbled upon a new issue. The program is supposed to ask me for an answer and it's programmed to go to a certain label when I type in a specific answer (in this case, if the answer is "file", go to the label "file"). The problem is, when I did this, the program instantly closed itself every time. I tried running the program in the Visual Studio Code terminal, it throws the error "The system cannot find the batch label specified - file".
The label file is indeed located within the program and I don't see any issues that would prevent the batch file from transferring into that position. It worked perfectly earlier, and since that, I don't recall changing anything within this portion of the code.
I tried carefully checking for typos once more, e.g. accidentally deleting a character somewhere, but everything seems fine and I can't find out what's wrong.
The code goes like this:
set /p choice="Enter your choice: "
if /i "%choice%" == "exit" exit
if /i "%choice%" == "file" goto file
echo.
echo Invalid choice.
pause
...
:file
cls
...
Any ideas on what should I do to fix this problem? I'm kind of a beginner in Batch and it's entirely possible I just made a stupid mistake somewhere. Any help is appreciated!
Question / choice system code screenshot
VSCode terminal output screenshot
Edit
The file I'm taking this code from is BIG. I won't be able to show the full code using the "type" command or any other command in general, however, I'm able to copy any specific part you want me to copy.