Lesson: Put a Menu in Your BAT File
Anguilla Library Computer Club|
Home | Lessons | Anguilla | News | Email
|Last time you created a boot disk with programs on it. Now improve autoexec.bat to ask which program to run. Use the same floppy disk as before and get to the DOS prompt.||When you "boot" your PC it performs the commands in autoexec.bat. You can make a BAT file very smart using the GOTO, CHOICE and IF commands, plus labels to jump to with GOTO.|
You now have the tools you need to add options to |
After the last program choice,
ask the user if he wants to go to the DOS prompt
or not? If the answer is N, jump to the
Test your new BAT file by typing autoexec and by pressing ALT-CTL-DEL. Be sure you can run each program. Congratulations--you can use this portable software menu on any PC with a matching floppy drive. Put your boot disk in a Ziploc bag to protect it. Take it home, impress your friends.
Extra Credit: Using the ECHO command and options of the CHOICE command, you can make this boot disk even more convenient by asking the user which program he wants to use.