I am taking an online class in DOS, and, unfortunately, the last problem is way over my head. Here's what I have to do: Create a simple menu system to help someone with DOS commands. It is to be a main program and another program that is called to display directory listings. To start, I have to display this menu:
DOS COMMAND ACCESS MENU
1--Format a Diskette
2--List the files on a disk
3--Exit the menu
Enter the number of the function you want to perform:
The batch file needs to determine which option the user selected. If Option 3, the screen should be cleared and the batch file terminated. If Option 1 or 2, the batch file needs to prompt the user for additional information before actually issuing the command that will accomplish the desired function.
Option 1 - should format only the A:drive.
Check the syntax and parameters for the FORMAT command. The batch file needs to determine which combination of parameters to use based on user-supplied information. Batch file should allow the user to choose whether to have the system files copied as part of the formatting procedure or not. The user should be prompted by your batch file to indicate whether or not this is to be a quick format. Once the paramenters have been clarified, the batch file should execute the appropriate version of the FORMAT command.
OPTION 2 - Check the syntax and parameters for the DIR command. The batch file needs to determine which combination of parameters to use based on user-supplied information. The batch file should allow the user to choose a directory listing of either the A: or C: drive. The user should also be prompted by your batch file to indicate whether the listing is sorted by date or size. Once the parameters have been clarified, the batch file should send the proper parameters to your second batch program, which will then execute the appropriate version of the DIR command.
If the user has picked either of the first two options, the batch file should return to the menu screen after the requested task is finished to see what the user wants to do next. The main batch program file should be named DOSMENU.BAT. The directory listing program file should be named DIRLIST.BAT. The batch file should be adequately documented using remark statements.
What I have so far:
@echo off
echo DOS COMMANDS ACCESS MENU
echo.
echo 1--Format a Diskette
echo 2--List the files on a disk
echo 3--Exit the menu
echo.
echo Enter the number of the function you want to perform.
echo.
choice /c:123
if errorlevel 3 goto end
if errorlevel 2 goto dotwo
if errorlevel 1 goto dothree
:dotwo
echo 1--List the files for Drive A:
echo 2--List the files for Drive C:
echo.
echo Enter 1 for Drive A: or two for Drive C:
choice /c12
if errorlevel 2 goto doc
if errorlevel 1 goto doa
:doc
If anyone can help correct this and finish the rest, I would sure appreciate it. The only help I have is the /? and that is just not cutting it for me. Thank you!