PowerPoint PresentationOverviewSlide 3Slide 4Slide 5Slide 6Concepts of Batch and Interactive ProcessingSlide 8Slide 9Slide 10Slide 11How Batch Files WorkSlide 13How Batch Files Work Table 10.1 Search Order for Extensions pp. 485-486Slide 15Slide 16Slide 17Using EDIT to Write Batch FilesSlide 19Slide 20Slide 21Slide 22Activity—Writing and Executing a Batch FileWriting and Executing a Batch File to Save KeystrokesWriting and Executing a Batch File to Save KeystrokesSlide 27Slide 28Using Batch Files to Alter Your Command Line EnvironmentSlide 30Slide 31Slide 32Slide 33Slide 34Slide 35Slide 36Slide 37Slide 38Activity—Creating a Batch File to Run NotepadSlide 40Special Batch File Commands Table 10.2 Batch File Commands pp.. 509-510Slide 42The REM CommandSlide 44Activity—Using REMThe ECHO CommandSlide 47The ECHO Command Table 10.3 ECHO ON or OFF p. 512Activity—Using ECHOActivity—Using ECHO Table 10.4 Echo On and ECHO Off: A Comparison of Screen Displays p. 516The CLS CommandActivity - Using CLSThe PAUSE CommandActivity—Using PauseStopping a Batch File from ExecutingSlide 56Activity—Quitting a Batch FileSlide 58Slide 59Replaceable Parameters in Batch FilesSlide 61Slide 62Slide 63Slide 64Activity—Using Replaceable ParametersMultiple Replaceable Parameters in Batch FilesMultiple Replaceable Parameters in Batch FileSlide 68Activity—Using Multiple Replaceable ParametersActivity—Using Multiple Replaceable Parameters Table 10.5 Positional Parameters p. 529Slide 71Slide 72Slide 73Creating Useful Batch FilesActivity—Writing Useful Batch FilesSlide 76Ch 10 1Introduction to Batch FilesCh 10 2OverviewOverviewWill learn to create batch files to automate a sequence of commands to accomplish various tasks.Ch 10 3OverviewOverviewThe use of batch file subcommands will be discussed and then used with batch commands.Ch 10 4OverviewOverviewHow to halt the execution of a batch file will be explained.Ch 10 5OverviewOverviewWill write batch files using replaceable parameters.Ch 10 6OverviewOverviewLearn how batch files can be used from the desktop.Ch 10 7Concepts of Batch and Concepts of Batch and Interactive ProcessingInteractive ProcessingBatch file:String together series of commands executed sequentially with one command without human interaction or interruptionCh 10 8Concepts of Batch and Concepts of Batch and Interactive ProcessingInteractive ProcessingBatch file:Must be an ASCII fileCreated with Edit, COPY CON, text editor, or word processor which has “Save as text file” optionHas .BAT or .CMD extensionEach line in batch file contains only one commandCh 10 9Concepts of Batch and Concepts of Batch and Interactive ProcessingInteractive ProcessingWhy batch files used:Minimize keystrokesAutomate frequent/consistent procedures Do not need to interact with computer while batch files are runningCh 10 10Concepts of Batch and Concepts of Batch and Interactive ProcessingInteractive ProcessingBatch processing:Automate frequent/consistent procedures Batch files can be run at anytimeNo user/computer interaction requiredCh 10 11Concepts of Batch and Concepts of Batch and Interactive ProcessingInteractive ProcessingInteractive processing: Also called online or real time mode User interacts directly with computer Information processed without delayCh 10 12How Batch Files WorkHow Batch Files WorkThe operating system determines if a file is a data file or a program file by its extension.Ch 10 13How Batch Files WorkHow Batch Files WorkTo locate file, operating system:Looks internally for commandUsing Extension Priority Rules, searches on default drive and directorySearches search path as set in PATH statement following Priority RulesCh 10 14How Batch Files WorkHow Batch Files WorkTable 10.1 Search Order for Extensions pp. 485-486Table 10.1 Search Order for Extensions pp. 485-486Ch 10 15How Batch Files WorkHow Batch Files WorkPriority rules are followed if there are files on a disk with the same file name but three different file extensions.Ch 10 16How Batch Files WorkHow Batch Files WorkIf file not found, get error message:“Filename is not recognized as an internal or external command, operable program, or batch file.”Ch 10 17How Batch Files WorkHow Batch Files WorkA batch file is a program.Each line in a batch file must contain only one command.Ch 10 18Using EDIT to Write Using EDIT to Write Batch FilesBatch FilesTo write a batch file you must use a program that creates ASCII text files.Ch 10 19Using EDIT to Write Using EDIT to Write Batch FilesBatch FilesIf a file is readable with the TYPE command, it is an ASCII text file.Ch 10 20Using EDIT to Write Using EDIT to Write Batch FilesBatch FilesWord-processing programs can create text files if they have a nondocument or text mode.Ch 10 21Using EDIT to Write Using EDIT to Write Batch FilesBatch FilesEDIT:Simple text editor in Command Prompt window Used to write batch files.Ch 10 22Using EDIT to Write Using EDIT to Write Batch FilesBatch FilesNotepad:Window’s text editorUsed to write batch filesCh 10 23Activity—Writing and Activity—Writing and Executing a Batch FileExecuting a Batch FileKEY CONCEPTS: Create batch files with:EDIT - tool to write batch filesAny text editor or word processor with ASCII output Batch file extensions - .BAT or .CMD Execute the batch file the same ways as you do any commandCh 10 24Writing and Executing a Writing and Executing a Batch File to Save KeystrokesBatch File to Save KeystrokesBatch files can save keystrokes.Examples: DIR/AD DIR/OS and DIR/O-SCh 10 25Sometimes easier to use COPY CON instead of EDIT to write simple batch file.Syntax:COPY CON filenameWriting and Executing a Writing and Executing a Batch File to Save KeystrokesBatch File to Save KeystrokesCh 10 26Drawbacks to using COPY CON:Cannot correct errors once <Enter> is pressed Cannot correct errors in existing files Writing and Executing a Writing and Executing a Batch File to Save KeystrokesBatch File to Save KeystrokesCh 10 27To correct errors need text editor like EDIT.Nothing is faster than COPY CON.Writing and Executing a Writing and Executing a Batch File to Save KeystrokesBatch File to Save KeystrokesCh 10 28KEY CONCEPTS:Pressing <F6> and <Enter> signals completion<Ctrl> +Z same as pressing <F6>Displaying file with TYPE indicates it is ASCII file Create one-line batch files Directories
View Full Document