Probably copy it upwards, to before the if block.
Better, put the exit if first, then the text display, then the version if block.
Also, the goto 1: could be cut out entirely, or some sort of "that is not an option" should be put in, otherwise it is a wasted branch check, and as everyone knows, it is always better to conserve a few CPU cycles, because these are the days of DOS when you only have 64k memory for both the program being run and all it's data....
(But seriously, that if for 1 is unneeded
, if my experience with C means anything Tested, anything not handled DOES fall through into 1:)
(This may only be a problem on XP)
Also: The E option was both:
I modified it. It should work better, at least on XP, and be much easier to add to, and be smaller in general.
It is not perfect, but the code is shrunk, both e and E exit, and invalid options are handled.
There is a C: on it's own, this handles the situation where you aren't already in the C drive, and cd won't work. All paths are in quotations, just in case.
@echo off
C:
cd "C:\Documents and Settings"
@echo 1 - Native
@echo 2 - Zombie Mod
@echo 3 - Cheat Mod
@echo 4 - Relentless Assault
@echo 5 - Zerg Mod
@echo 6 - 23a (2d Edition)
@echo E - Exit
set /p dfversion=What version of DF do you want to run?
if "%dfversion%" == "E" goto :exit
if "%dfversion%" == "e" goto :exit
cls
color 1F
@echo.
@echo DDD FFFFFF
@echo D D F
@echo D D FFFF
@echo D D F
@echo D D F
@echo DDDwarf Fort
@echo.
@echo.
if "%dfversion%" == "1" goto :1
if "%dfversion%" == "2" goto :2
if "%dfversion%" == "3" goto :3
if "%dfversion%" == "4" goto :4
if "%dfversion%" == "5" goto :5
if "%dfversion%" == "6" goto :6
cls
echo invalid option
pause
exit
:1
pause
cd "40d Native"
goto :run
:2
pause
cd "40d Zombie Mod"
goto :run
:3
pause
cd "40d Cheat"
goto :run
:4
pause
cd "40d Relentless Assault"
goto :run
:5
pause
cd "40d Zerg"
goto :run
:6
pause
cd "23a Native"
goto :run
:exit
cls
pause
exit
:run
dwarfort.exe
exit
I left all the old options in place, as examples, but you would have to edit the path and possibly the drive. Fortunately, they are both in the same place, at the top of the file, so you only need to change them once.