Filename: 'mymenu.bat' -------- Start cut to paste here -------- @echo off :top cls Echo. Echo My Main Menu Echo ============ Echo DOS (P)rompt Echo (W)indows Echo DOS (S)hell Echo. Choice /c:pws /t:p,10 Which Environment If errorlevel 3 goto shlrun If errorlevel 2 goto winrun If errorlevel 1 goto dosrun :shlrun call dosshell.bat pause goto top :winrun call windows.bat pause goto top :dosrun prompt Type 'mymenu' for Main Menu$_$p$g --------- End cut to paste here -------- |
Filename: 'windows.bat' ------- Start cut to paste here -------- @echo off cd\windows win --------- End cut to paste here -------- |
By also creating a windows.bat file you can return to your menu when you close Windows (exist to a DOS prompt in Windows 95).
If you do not have the dosshell.bat or windows.bat files, the program will simply report a bad command and then continue. You can replace these names with the start commands for your own programs (don't forget to edit the menu text and choice letters).
This file modifies the prompt when it exits to DOS. To restore your original prompt, go to a DOS prompt and type prompt $p$g.
If you create a menu you want to see every time your system starts, edit the autoexec.bat file. Add the batch file name on a line just above the line with win.com, then save it, and restart your computer.
Here are a few popular batch file commands:
Note: Items in [] are optional.
Echo [on/off] [text]
Turns display on or off.
Echo.
Displays a blank line.
Cls
Clears the display.
Pause
Stops, waits for key press.
:name
A Label.
Goto name
Jumps there.
If [true/false] [action]
Logic test, then action if true.
Call batch file
Use to run another batch file.
Choice [/c:choices] [/T:c,nn] [query]
Requests user input.