Download presentation
Presentation is loading. Please wait.
Published byBrenda Matthews Modified over 9 years ago
1
Command Prompt Chapter 10 Introduction to Batch Files Richard Goldman February 7, 2000
2
Batch File A batch file is an ASCII text file that contains a list of commands that the operating system can execute. A batch file must end with a.BAT extension. A batch file is run by entering its name at the command prompt. A batch file may be interrupted by pressing [Ctrl] + C or [Ctrl] +[Break].
3
Creating a Batch File Batch files can be written with any word processor or editor that can save files in ASCII text format. The MS DOS editor if often used while in DOS for working with batch files. You may also use the COPY CON [filename.bat] to write simple BAT files.
4
Batch file Commands Call – Calls another batch file CHOICE – Pauses file and asks user to enter a response to a question. (Not available in Win 2000) ECHO – Displays or hides text. FOR – Runs a command for files in a set. GOTO – Directs flow to specified label. IF – Conditional processing. PAUSE – Temporally stops processing. REM – Used to document batch file. SHIFT – Shifts replaceable parameters
5
REM Command Used to document a batch file. No action will be taken on lines that start with a REM statement.
6
Replaceable Parameters Allows users to enter variables at the command prompt that the batch file can use. You can reference parameters 1-9 (0 is the position of the command). Substitute % followed by the entry order number of the parameter. Example: %3
7
AUTOEXEC.BAT File The AUTOEXEC.BAT file is automatically run after the system is booted in Win 9X. Not used with NT Operating Systems. The system looks for it in the root directory.
8
End
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.