DOC PREVIEW
DMC ITSC 1405 - Chapter 11 Advanced Batch Files

This preview shows page 1 out of 3 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 3 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Instructor: Prof. Michael P. Harris Chapter 11ITSC 1405 – Intro to PC Operating Systems Advanced BATCH FilesChapter 11Advanced Batch FilesLEARNING OBJECTIVES1. List the commands used in batch files.2. List and explain batch file rules.3. Explore the function of the REM, PAUSE, and ECHO commands.4. Explain the use of batch files with short cuts.5. Explain the purpose and function of the GOTO command.6. Explain the purpose and function of the SHIFT command.7. Explain the purpose and function of the IF command.8. Explain the purpose and function of the IF EXIST/IF NOT EXIST command.9. Explain the purpose and function of the IF ERRORLEVEL command.10. Explain the purpose and function of writing programs.11. Explain the purpose and function of the environment and environmental variables.12. Explain the use of the SET command.13. Explain the purpose and function of the FOR…IN…DO command.14. Explain the purpose and function of the CALL command.STUDENT OUTCOMES1. Use the ECHO command to place a blank line in a batch file.2. Use the GOTO command in conjunction with a label to create a loop.3. Use a batch file with a shortcut.4. Use the SHIFT command to move parameters.5. Use the IF command with strings for conditional processing.6. Test for null values in a batch file.7. Use the IF EXIST/IF NOT EXIST command to test for the existence of a file or a subdirectory.8. Use the SET command.9. Use the environment and environmental variables in batch files.10. Use the IF ERRORLEVEL command with XCOPY to write a batch file for testing exit codes.11. Use the FOR…IN…DO command for repetitive processing.12. Use the CALL command in a batch file.Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line Page 1Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1Instructor: Prof. Michael P. Harris Chapter 11ITSC 1405 – Intro to PC Operating Systems Advanced BATCH FilesCHAPTER SUMMARY1. You may substitute a double colon (::) for the REM statement.2. To place a blank line in a batch file, use the ECHO command followed immediately by a period (ECHO.).3. The GOTO command used in conjunction with a label creates a loop. The GOTO will process the command following the label.4. The label in a batch file is not a command, but identifies a location in the batch file.5. The SHIFT command shifts over command line parameters to the left one position at a time.6. The SHIFT command is typically used in conjunction with GOTO and a label.7. The IF command will test for some logical condition. If the condition is true, the command will be processed. If the condition is false, the batch file will fall through to the next line of the batch file.8. The IF command can test whether or not two character strings are identical.9. The IF command can test whether or not a file exists.10. The IF command checks ERRORLEVEL.11. You may also use IF with NOT. The IF NOT command will test for a NOT condition. If a condition is not true, then the command will process. If the command is true, then the batchfile will fall through to the next line in the batch file.12. You can test for a null value by using quotation marks, a word, or backslashes.13. To use IF EXIST and to test for the existence of a subdirectory, you may use IF %1\NUL.14. Many programs set an exit code when finished executing. The IF ERRORLEVEL in a batchfile will test if an exit code is equal to or greater than the one in the test.15. When you use IF ERRORLEVEL in a batch file, the codes must be listed in descending order.16. When you use IF NOT ERRORLEVEL in a batch file, the codes must be listed in ascending order.17. You may write programs with DEBUG to set exit codes.18. You can write programs directly in DEBUG, or you may write a script file that supplies input for DEBUG to create a program.19. The environment is an area in memory where the operating system leaves messages to itself, including the path and the prompt values.20. You can create environmental variables that can be used in batch files. When using the variable in a batch file, the syntax is %variable%.21. The SET command lets you view what is currently in the environment.22. Environmental variables set in other batch files or at the command line remain in effect only during the current Command Prompt session. When the Command Prompt window is closed, the variable disappears.23. The DIRCMD command can be used to preset the DIR command parameters and switches.24. The FOR…IN…DO command allows repetitive processing. The command will execute some command for every value in a specified set.25. When you use FOR…IN…DO at the command line, the syntax is FOR %variable IN (set) DO command [command-parameter].Carolyn Z. Gillay, Bette A. Peat, Windows XP Command Line Page 2Franklin, Beedle & Associates ©2003 ISBN: 1-887902-82-1Instructor: Prof. Michael P. Harris Chapter 11ITSC 1405 – Intro to PC Operating Systems Advanced BATCH Files26. The /R when used with FOR…IN…DO allows recursive processing. Recursive means that the command will search all the directories.27. Using the /F parameter allows you to select specified text using delimiters that you can set.28. The CALL command allows you to call one batch file from another. When the second batchfile is finished executing, it returns control to the first batch file.KEY TERMSdebugEOF (end-of-file) markexit codeconditional processingenvironmentenvironmental variableexpressionloopnull valuerecursivescan codescript filevariableCarolyn Z. Gillay, Bette A. Peat, Windows XP Command Line Page 3Franklin, Beedle & Associates ©2003 ISBN:


View Full Document

DMC ITSC 1405 - Chapter 11 Advanced Batch Files

Documents in this Course
Firewall

Firewall

53 pages

Syllabus

Syllabus

11 pages

Load more
Download Chapter 11 Advanced Batch Files
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Chapter 11 Advanced Batch Files and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Chapter 11 Advanced Batch Files 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?