Question:
Syntax error in my batch file. Help?
Joaquin Varela
2012-08-18 18:59:22 UTC
I get a syntax error in my little program. If you could take the time to read it's code and tell me what I did wrong I would appreciate it. http://uppercut.tk/redyoshi/stuff/other/launch.bat
Three answers:
The Outcaste
2012-08-18 21:26:56 UTC
These 5 lines will cause an error, there is no command

IF %M%==5

IF %M%==6

IF %M%==7

IF %M%==8



The labels on these lines don't exist, so they will cause a fatal error, and the S variable is never defined. Probably a typo, should be M.

IF %S%==S GOTO Settings

IF %M%==0 GOTO EXIT



If you want to exit, that line should be:

IF %M%==0 EXIT

Or you can use the predefined label :EOF

IF %M%==0 GOTO :EOF



You should clear the variable before the Set /P statement, otherwise if someone just presses enter, the previous choice will be used. And quote both sides, otherwise if someone just presses Enter the first time around, you'll get an error.

SET M=

SET /P M=Type the option # then press ENTER:

IF "%M%"=="1" GOTO Vanilla

IF "%M%"=="2" GOTO Bukkit

IF "%M%"=="3" GOTO Tekkit

IF "%M%"=="4" GOTO HackMine

IF "%M%"=="C" GOTO Client

IF "%M%"=="S" GOTO Settings

IF "%M%"=="0" GOTO EXIT
micksmixxx
2012-08-18 19:06:43 UTC
No, I'm afraid I can't read it. I don't know who you are, and I don't trust you, so I'm not even going to try.



Why don't you use just a modicum of intelligence and past a copy of your .bat file here so that people can look at it that way?
?
2016-12-08 21:45:00 UTC
you're able to be able to desire to place rates around it if there are areas: reproduction "C:My Documentssandwich.txt" D: additionally, you're able to desire to evaluate making use of xcopy because it provides you with greater suggestions and administration.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...