I have a batch file, and was making an if statement. Then I went in and tested it. It closed, so I got an error log that said 'goto was unexpected at this time.' It was working before, and the other if statements still work, why would this particular one not work? This is the non-working command: if %luck% == 1 goto lucky
This is the working command: if %svgnum% == back goto mainmenu
They are about the same, besides the variables.
Honestly all I can say is syntax's in batch are very sensitive,
the smallest difference in code can mess with a lot of different parts of your batch.I see no problem, but from my own experience I've had a batch function wrong because of spaces in the statement.
Instead of using:
if %luck% == 1 goto luckyUse:
if %luck%==1 goto luckyAlso make sure that there is a :lucky for the batch to goto.
| « Using Inputs in Batch | GTK glade/gedit PLEASE HE... » |