Batch File
-
- Posts: 1741
- Joined: Wed Jul 23, 2003 7:00 am
Batch File
Well for school I need to create a DOS batch file that will promt for a choice of games and have a box made of asteriks surrounding the choices. The games are located on C:\GAMES\<game folder>\<game exe file>. The choices will start with 3 games and build up to about 12. Anyone able to help me with this?
[size=92][color=#0000FF]Hugh Hefner for President[/color][/size]
-
- Posts: 6926
- Joined: Thu Feb 10, 2000 8:00 am
-
- Posts: 1741
- Joined: Wed Jul 23, 2003 7:00 am
Uh.. its pretty simple.. just google dos commands, you can pretty much figure it out yourself..
hint, Txt files are handy in this..
hint, Txt files are handy in this..

[size=75][i]I once had a glass of milk.
It curdled, and then I couldn't drink it. So I mixed it with some water, and it was alright again.
I am now sick.
[/i][/size]
[img]http://img162.imageshack.us/img162/3631/171164665735hk8.png[/img]
It curdled, and then I couldn't drink it. So I mixed it with some water, and it was alright again.
I am now sick.
[/i][/size]
[img]http://img162.imageshack.us/img162/3631/171164665735hk8.png[/img]
-
- Posts: 448
- Joined: Tue Mar 19, 2002 8:00 am
-
- Posts: 1741
- Joined: Wed Jul 23, 2003 7:00 am
Well here is what I have so far.
@echo off
:Begin
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo. *******************
echo. * A - Donkey Kong *
echo. * B - Mario *
echo. *******************
echo.
echo.
echo.
CHOICE /n /C:12 Pick a Game
If errorlevel ==2 goto 2Mario
If errorlevel ==1 goto 1Kong
goto end
:2Mario
C:\GAMES\MARIOBRO\Mario.exe
cls
goto end
:1Kong
C:\GAMES\DONKEYKO\ckong.exe
cls
goto end
:end
cls
the many echos are to get the menu choice in the center of the screen. There are also many spaces, but the forum doesn't show them. The only thing is we must make it so that when you exit the game the menu must reappear, which isn't that hard to do, but we need to enter in as an option, exit to DOS, how does one do that. I tried using an :away for an option, but it just exits no matter what you choose.
@echo off
:Begin
cls
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo.
echo. *******************
echo. * A - Donkey Kong *
echo. * B - Mario *
echo. *******************
echo.
echo.
echo.
CHOICE /n /C:12 Pick a Game
If errorlevel ==2 goto 2Mario
If errorlevel ==1 goto 1Kong
goto end
:2Mario
C:\GAMES\MARIOBRO\Mario.exe
cls
goto end
:1Kong
C:\GAMES\DONKEYKO\ckong.exe
cls
goto end
:end
cls
the many echos are to get the menu choice in the center of the screen. There are also many spaces, but the forum doesn't show them. The only thing is we must make it so that when you exit the game the menu must reappear, which isn't that hard to do, but we need to enter in as an option, exit to DOS, how does one do that. I tried using an :away for an option, but it just exits no matter what you choose.
[size=92][color=#0000FF]Hugh Hefner for President[/color][/size]