Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write this command script 1.This exercise has you creating a more encompassing command script that will provide a simple menu system. Here are the specific

write this command script 1.This exercise has you creating a more encompassing command script that will provide a simple menu system. Here are the specific requirements for this script: a. The batch file will be called ProcessText.bat b. The batch file will take 1 parameter at the command line. This parameter represents the pathname of a text file to process c. If the parameter (i.e. the text file) is not provided, your script should display an appropriate error message and end the batch file d. If the text file is provided, your script should check to make sure that the file exists. If not, display an appropriate error message and end the batch file e. If the text file exists, then your script should clear the screen and display a menu with the 4 options as follows: 1.Open in Notepad 2.Open in Word 3.Open in Notepad++ 4.Printf. You will need to develop a simple C program called myChoice.exe. This program will: i. Prompt the user for some input ii. Verify that whatever the user entered is numeric (i.e. they entered a number) If they didnt enter a number then myChoice.exe will return a value of -1 If they entered a number, then myChoice.exe will return this value iii. Please note that this program does not display the menuto the user nor does it check for the valid range of menu options iv. The only thing that this program can prompt the user with is the phrase Please make menu choice g. After the menu in step 5 above is displayed, your script will execute the program called myChoice.exe i. You can assume that your myChoice.exe executable is in the same directory as ProcessText.bat ii. Your script will need to check the ERRORLEVEL variable when the program exits in order to get the return value from the main() function in myChoice.exe h. Depending on the value returned from the program your script must invoke the appropriate action i. Open the correct editor or print the file if the returned value is in the range 1 to 4 Please use the lab computers for the path / installation locations of these editors and launch the programs using this path. Make sure that you have found the actual executable and are using that path information rather than a shortcut or link to the application. You may use Notepads ability to print the text file as demonstrated in the other batch files After this action is taken, the batch file will exit i. If the choice is outside of the allowable range then your script should display an appropriate message to the user and allow them to read it. In this case, the menu should be redrawn and allow the user to choose a valid selection.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Securing SQL Server Protecting Your Database From Attackers

Authors: Denny Cherry

3rd Edition

0128012757, 978-0128012758

More Books

Students also viewed these Databases questions

Question

3. Outline the four major approaches to informative speeches

Answered: 1 week ago

Question

4. Employ strategies to make your audience hungry for information

Answered: 1 week ago