Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ch 101 Chapter 10 Introduction to Batch Files. Ch 102 Overview A batch file is a text file that contains an ordered series of commands.

Similar presentations


Presentation on theme: "Ch 101 Chapter 10 Introduction to Batch Files. Ch 102 Overview A batch file is a text file that contains an ordered series of commands."— Presentation transcript:

1 Ch 101 Chapter 10 Introduction to Batch Files

2 Ch 102 Overview A batch file is a text file that contains an ordered series of commands.

3 Ch 103 Overview Batch files allow the user to …  automate a process  create more powerful commands

4 Ch 104 Concepts of Batch & Interactive Processing A batch file contains one or more commands.

5 Ch 105 Concepts of Batch & Interactive Processing A batch file must have the extension.BAT

6 Ch 106 Concepts of Batch & Interactive Processing Batch files allow the user to …  minimize keystrokes  minimize the possibility of errors

7 Ch 107 Concepts of Batch & Interactive Processing In interactive processing (real- time mode) …  the user directly interacts with computer  info. is processed without delay

8 Ch 108 How Batch Files Work The difference between Data and Program files is determined by their file extensions.

9 Ch 109 How Batch Files Work Priority rules are followed when the OS looks for a file to load and execute.

10 Ch 1010 How Batch Files Work The.BAT extension is the last file extension the OS looks for when trying to execute a program.

11 Ch 1011 Using EDIT to Write Batch Files To write a batch file …  must use a program that creates ASCII text files.

12 Ch 1012 Using EDIT to Write Batch Files Word processing programs can create text files, but …  they are very large  they take a long time to load into memory

13 Ch 1013 Using EDIT to Write Batch Files EDIT is the small, simple text editor in MS-DOS used to write batch files.

14 Ch 1014 Using EDIT to Write Batch Files Notepad is the text editor in Windows that can be used to write batch files.

15 Ch 1015

16 Ch 1016 Writing and Executing a Batch File to Save Keystrokes It is sometimes easier to use COPY CON instead of EDIT to write a simple batch file.

17 Ch 1017 Writing and Executing a Batch File to Save Keystrokes Two drawbacks to using COPY CON: Ê Cannot correct errors once is pressed Ë Cannot correct errors in existing files

18 Ch 1018 Writing and Executing a Batch File to Save Keystrokes Must use EDIT to correct errors.

19 Ch 1019

20 Ch 1020 Using Batch Files to Load Application Software To launch an application in Windows …  click program icon  select program from menu  use the toolbar

21 Ch 1021 Using Batch Files to Load Application Software To launch an application program from the command line …  must create a batch file

22 Ch 1022 Using Batch Files to Load Application Software Need to follow three steps in order to load application software in MS-DOS.

23 Ch 1023

24 Ch 1024 Writing a Batch File to Load an Application Program By creating a batch file, a user can simplify the process of loading an application program in MS-DOS.

25 Ch 1025

26 Ch 1026 Creating Shortcuts for Batch Files on the Desktop To run a batch file from Windows:  click file name in Explorer/My Computer  create shortcut for file and place on desktop

27 Ch 1027

28 Ch 1028 Special Batch File Commands There are nine commands specifically designed to be used in batch files.

29 Ch 1029 Special Batch File Commands  CALL  CHOICE  ECHO

30 Ch 1030 Special Batch File Commands  FOR  GOTO  IF

31 Ch 1031 Special Batch File Commands  PAUSE  REM  SHIFT

32 Ch 1032 The REM Command REM command ( remarks )... statements keyed in by user that tell what is the purpose of the batch file

33 Ch 1033

34 Ch 1034 The ECHO Command ECHO command … displays a command and the output of that command to the screen.

35 Ch 1035 The ECHO Command The default value for ECHO is ON.

36 Ch 1036 The ECHO Command Can turn off the display of the command and only see the output of the command.

37 Ch 1037 The ECHO Command

38 Ch 1038

39 Ch 1039 Activity: Using ECHO

40 Ch 1040 The PAUSE Command PAUSE command … instructs the batch file to stop executing until the user takes some action.

41 Ch 1041

42 Ch 1042 Stopping a Batch File from Executing Two ways to interrupt a batch file during execution: Ê Press + C Ë Press +

43 Ch 1043

44 Ch 1044 Replaceable Parameters in Batch Files Many commands use variable or replaceable parameters.

45 Ch 1045 Replaceable Parameters in Batch Files Batch files can also use replaceable parameters.

46 Ch 1046 Replaceable Parameters in Batch Files Replaceable parameters are used to limit the number of batch files that do the same thing, but use different names.

47 Ch 1047 Replaceable Parameters in Batch Files Place holders are needed to indicate to the batch file that a variable ( file name ) will be keyed in.

48 Ch 1048 Replaceable Parameters in Batch Files The place holder used in batch files is the percent sign (%), followed by a number (0-9).

49 Ch 1049 Replaceable Parameters in Batch Files The % sign is a signal to the OS that a parameter is coming.

50 Ch 1050 Replaceable Parameters in Batch Files The numbers (0-9) indicate what position the parameter is on in the command line.

51 Ch 1051

52 Ch 1052 Multiple Replaceable Parameters in Batch Files Many commands used in batch files may require more than one parameter.

53 Ch 1053 Multiple Replaceable Parameters in Batch File Batch files can have up to 10 replaceable parameters (%0-%9).

54 Ch 1054

55 Ch 1055 Activity: Using Multiple Replaceable Parameters

56 Ch 1056 Creating Useful Batch Files With batch files a user can create new commands that are not provided by the OS.

57 Ch 1057

58 Ch 1058 Understanding AUTOEXEC.BAT AUTOEXEC.BAT is a file that …  runs when the system is booted  contains specific commands that a user chooses to run

59 Ch 1059 Understanding AUTOEXEC.BAT Interactive booting … user is asked by the computer if s/he wants to execute each line in the CONFIG.SYS and AUTOEXEC.BAT files.

60 Ch 1060

61 Ch 1061 Controlling the Boot Process During booting process, the user may experience problems that are related to instruction statements in the CONFIG.SYS or AUTOEXEC.BAT files.

62 Ch 1062 Controlling the Boot Process By pressing certain function keys, the user can control the boot process in order to correct problems that arise.

63 Ch 1063


Download ppt "Ch 101 Chapter 10 Introduction to Batch Files. Ch 102 Overview A batch file is a text file that contains an ordered series of commands."

Similar presentations


Ads by Google