PRINCE GEORGE’S COMMUNITY COLLEGE

CIS-170

Project 3

In this project you will have the opportunity to create a batch file that will make a decision. The decision will tell the batch file to take one of two possible actions. One action will be to execute one series of commands (Command-Set-A), the other action is execute an entirely different set of commands (Command-Set-B),. The batch file will decide which action to take (Command-Set-A , or Command-Set-B ) based upon what was entered at the command prompt.

There are two phases to this project. Phase One create a batch file that will make a decision, Start.Bat. The decision is either branch to Alpha.Bat or branch to Brava.Bat and then return to the original batch file ,Start.Bat.

Phase Two, create two other batch files (Alpha.Bat and Brava. Bat) that Start.Bat can branch to.

Phase One

Create a batch file (named Start.Bat) that will:

    1. Echo a message to the screen that you are in the start batch file.
    2. Echo a message that you are about to display the contents of the root directory on the c: drive
    3. Display the contents of the root directory on the c: drive
    4. Create a file called dirfile that contains the output of the display of the root directory.
    5. Verify that the file was indeed created
    6. Display the contents of dirfile
    7. Based upon what was entered as a replaceable parameter launch the appropriate batch file.
    8. Echo a message that you are leaving this batch file and starting the appropriate batch file
    9. Echo a message that you are now back in this batch file
    10. Echo a message that you are now exiting out of this batch file
Save the batch file named Start.Bat in the Proj2 subdirectory.
 
 

Phase Two

Create two batch files named Alpha.Bat and one named Brava. Bat. Both batch files should:

    1. Echo statements that you are in the appropriate batch file
    2. Echo statements that you are exiting the appropriate batch file and returning to the original batch file (start)
Save both batch files Alpha.Bat and Brava. Bat in the Proj2 subdirectory.

Make sure that each batch files begins with the following commands;

@echo off

Rem Author Your name

Rem

Rem your class night