Absolute Beginners Guide to A+ Certification. Covers the Hardware and Operating Systems Exam
< Day Day Up > |
Using ECHO
ECHO is used in batch files to control whether the commands and responses in the batch file are displayed ( ECHO ON ) or not displayed ( ECHO OFF ). Use ECHO with no options to see the current setting for ECHO . The following batch file demonstrates typical uses for ECHO : @ECHO OFF ECHO The following command displays the contents of the current folder DIR/W ECHO The preceding is the listing of the contents of the current folder
When this batch file is run, the user will see the following: The following command displays the contents of the current folder [directory listing] The preceding is the listing of the contents of the current folder Using TYPE
The TYPE command is used to display the contents of a file to the screen. It is normally used with text files (including .BAT, Config.sys, and other text-based configuration files). TYPE MYFILE.TXT displays the contents of myfile.txt to the screen. Using Folder-Management Commands ( MKDIR , CHDIR , RMDIR )
You can make, change to, or remove folders (directories) with the following commands as shown in Table WCR.2. Table WCR.2. Folder Management Commands
Folders (directories) can be referred to in two ways:
An absolute path provides the full path to the folder. For example, to change to the folder \Backups\Word from the folder \My Documents on the same drive, you would use the command CHDIR \Backups\Word .
A relative path can be used to change to a folder one level below your location. For example, to change to the folder \Backups\Word from the folder \Backups , you would use the command CHDIR Word . No backslash is necessary. To change to the root folder from any folder, use CHDIR \ . To change to the folder one level higher than your current location, use CHDIR .. . |
< Day Day Up > |