Computing.Net > Forums > Disk Operating System > clean screen and menu

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

clean screen and menu

Reply to Message Icon

Name: guy
Date: May 24, 2003 at 04:44:45 Pacific
OS: 98
CPU/Ram: 4, 128
Comment:

when i shut my windows and start the computer in dos
i want to see clean screen with a menu that i wrote
for now all i know is that the menu coul'd be in a batch file



Sponsored Link
Ads by Google

Response Number 1
Name: Secret_Doom
Date: May 24, 2003 at 14:52:51 Pacific
Reply:

Yeah, you could create a batch file (.bat) with a menu, and make dosstart.bat to execute it. That dosstart.bat, which is under the windows folder, gets executed when you select the option "Restart the computer in MS-DOS mode" on the Start Menu from Windows.

From your post, I couldn't understand if you already have that menu written or not. There are some examples on how to make a menu via batch file on my FAQ:

FAQ #10 - Make a menu

After making that batch file, just add a line refeering to it on the end of dosstart.bat. For instance:

call c:\MyBatchFiles\MyMenu.bat

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br

_____________________________________________________


0

Response Number 2
Name: guy
Date: May 25, 2003 at 01:23:38 Pacific
Reply:

thank you this exactly what i want.
about the menu:
i just start learning dos programming and i can't understand some part in your great example.

i woul'd love to know about a site how teach from the beginning programming in dos.


0

Response Number 3
Name: Secret_Doom
Date: May 25, 2003 at 12:45:11 Pacific
Reply:

Try these tutorials:

http://gatsby.tafe.tas.edu.au/batch/index.htm

http://life.homepage.dk/batfiles/

If you want an explanation on a specific part of a batch file code, I can give it to you.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 4
Name: guy19
Date: May 26, 2003 at 04:40:36 Pacific
Reply:

i want to make more than let say 9 choices and i want to choose options with numbers.
so i need to be able to write two digit numbers.
it's say's that my choice will be read only after ENTER.

thanks for the links


0

Response Number 5
Name: Secret_Doom
Date: May 26, 2003 at 20:20:26 Pacific
Reply:

You can:

1. Specify letters instead of numbers associated to the options (the simpler solution).

2. Use another way of getting user input, which would be like you described - only finished when user hits enter. That is covered in my FAQ #06 - get user input.

3. Use a combination of CHOICE prompts. Something like this:

@echo off
echo Choose an option:
echo.
echo [01] Option 1
echo [02] Option 2
(...)
echo [20] Option 20
:choice
CHOICE /c:120 /n > nul
for %%? in (1 2) do if errorlevel=%%? set d1=%%?
if errorlevel=3 set d1=0
CHOICE /c:1234567890 /n > nul
for %%? in (1 2 3 4 5 6 7 8 9) do if errorlevel=%%? set d2=%%?
if errorlevel=10 set d2=0
if "%d1%"=="2" if not "%d2%"=="0" goto choice
echo You've chosen option %d1%%d2%

The prompt messages ("[1,2]?") won't be displayed, so the interface looks like a single prompt for a 2-digit-number. However, as you can see, that method is not very neat, there are some difficulties associated to it, like the problem avoided by the line before the last line of code - if the user hits 2 on the first prompt and then anything other than 0 on the second prompt, that isn't a valid option and we must get back to the prompting. If more options were avaliable, like 21 22 23, it would take more trouble to make sure the entry is valid.

I recommend using method 1, unless you've got a relevant reason to use method 2 or 3.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br

________________________________________________________________


0

Related Posts

See More



Response Number 6
Name: guy19
Date: May 28, 2003 at 13:33:46 Pacific
Reply:

after i choose a game on the menu and finish to play
i want to see the menu again
how i do it ?


0

Response Number 7
Name: Secret_Doom
Date: May 29, 2003 at 15:50:26 Pacific
Reply:

Use something like this:

@echo off
:menu
cls
echo.
echo Choose:
echo.
echo [1] Doom
echo [2] Heretic
echo.
echo [0] Exit
echo.
choice /c:012
if errorlevel=3 goto heretic
if errorlevel=2 goto doom
goto end
:heretic
c:\games\heretic\heretic.exe
goto menu
:doom
c:\games\doom\doom.exe
goto menu
:end

Notice the importance of including an option for exiting the batch file.

-- Leonardo Pignataro - Secret_Doom --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: clean screen and menu

Send info to screen and log file www.computing.net/answers/dos/send-info-to-screen-and-log-file/9374.html

how to redirect to screen and file www.computing.net/answers/dos/how-to-redirect-to-screen-and-file-/12950.html

Dos menuer and arachne login www.computing.net/answers/dos/dos-menuer-and-arachne-login/13334.html