OMG im doing this batch file assigment for my uni. and its made up of 4 files but i cant even the the first to work proberly casue if i try move it or rename it it dosnt work. tehre such a pain in the ass.
This is the code. Quote:
@ECHO OFF REM Written by Craig Rachow
:mainMENU CLS ECHO 1. Applications ECHO 2. Utilities ECHO 3. Games ECHO 4. Quit ECHO. CHOICE /C:1234 /N Please enter a choice[1,2,3,4] : IF ERRORLEVEL == 4 GOTO END IF ERRORLEVEL == 3 GOTO gamesMENU IF ERRORLEVEL == 2 GOTO utilsMENU IF ERRORLEVEL == 1 GOTO appsMENU :gamesMENU CALL GAMES.BAT GOTO mainMENU :utilsMENU CALL UTILS.BAT GOTO mainMENU :appsMENU CALL APPS.BAT GOTO mainMENU :END
no such thing as choice.bat. it was a dos command, not another batch file.
if you want to stop a line displaying in dos, prepend it with an @ sign.
eg, @set /p .....
or, as in knights example, begin the batch file with @echo off to disable echoing completely.
also, i think i just figured out what you were really asking, when using the set method, the /n /c:1234 is not necessary. you will need to do some form of error checking on the input to make sure its within the range you want it to be in.
i did this last year... was fun... it was also good cause the teacher opened one up that 3 of us made and it opened up every program on his computer and shut it down :)
Well good news people I got it to run like a 4 legged dog So im all happy I’m not gonna post it cause 3vil will properly tax it and I want him to do it him self and suffer the frustration like I did :P