You are on page 1of 29

Chapter 2 –

COMMAND SYNTAX
Using the DIR Command with
Parameters and Wildcards

Chapter 2 (30 slides) 1


2.4 Using Fixed Parameters
with the DIR Command
Notes for lab activities:
 Check notes at beginning of each activity
 At end of work session return to Windows
desktop and follow shut-down procedure
 Know your laboratory procedures
 If system varies from text refer to the
Configuration Table in Chapter 1.6

Chapter 2 (30 slides) 2


2.5 Activity:
Using Fixed Parameters with
the DIR Command
KEY CONCEPTS:
 Clear Screen
 Display directory using:
 /P parameter
 /W parameter
 /P /W parameters
 Delimiter

Chapter 2 (30 slides) 3


2.5 Activity:
Using Fixed Parameters with
the DIR Command
Your Turn…
1. Turn on the Computer, if not already
2. Open a Command Prompt window
3. Type CD \
4. Type CLS
5. Insert Activities disk-Working Copy in drive A
6. Type A:
7. Type DIR /P

Chapter 2 (30 slides) 4


2.5 Activity:
Using Fixed Parameters with
the DIR Command
Your Turn…
8. Press <CR>
9. Press <CR> again
10. Press <CR> until you reach end of display
11. Type DIR /W
12. Type DIR /P /W
13. Press <CR>

Chapter 2 (30 slides) 5


2.7 Activity:
Using File Names as a Variable
Parameter
KEY CONCEPTS:
 System messages
 DIR command with long file names
 File extensions - more than 3 characters
 8.3 file name
 Use of quotation marks
 Use of /x parameter
 How 8.3 name derived from LFN
 Reasons for keeping file names short/concise

Chapter 2 (30 slides) 6


2.7 Activity:
Using File Names as a
Variable Parameter
Your Turn…
1. Type DIR VENUS.TXT
2. Type DIR NOFILE.TXT
3. Type DIR STEVEN.FIL C:\WINDOWS\SYSTEM32\DISKCOPY.COM
4. Type DIR LONGFILENAME

Chapter 2 (30 slides) 7


2.7 Activity:
Using File Names as a
Variable Parameter
Your Turn…
5. DIR LONGFILENAME.EXTENSION
6. DIR Sandy and Patty.txt
7. DIR “Sandy and Patty.txt”
8. DIR /X /P
9. Continue pressing <CR> noting files with “LONGFIL…”

Chapter 2 (30 slides) 8


2.9 Activity:
Using Command Line Editing
KEY CONCEPTS:
 Use editing keys to recall and edit commands
 Overstrike mode
 Insert mode
 Delete line quickly by using <Esc> key
 How to search for previously entered command

Chapter 2 (30 slides) 9


2.9 Activity:
Using Command Line Editing
Your Turn…
1. DIR /p
2. Press F1 twice
3. Press ESC key to cancel the command
4. Press ALT+F7 to clear the memory of the command
line editor
5. CLS
6. DIR FRANK.FIL
7. DIR VEN.99
8. VOL

Chapter 2 (30 slides) 10


2.9 Activity:
Using Command Line Editing
Your Turn…
9. DIR JUP.99
10. DIR ORION.NEB
11. DIR DRESS.UP RIGHT.UP
12. Press ↑ twice
13. Press ↓ once
14. Type CTRL + ← once
15. Press Insert key
16. At cursor, type FILE3.FP
17. Press <CR> then Press ↑ twice

Chapter 2 (30 slides) 11


2.9 Activity:
Using Command Line Editing
Your Turn…
18. Press CTRL + ← once, type FILE2.FP
19. Press F7
20.Press F9 then number before DIR VEN.99
21. Press Esc, Press D, Press F8
22.Press Esc, Press ALT + F7, Press ↑ Once
23.Close the Command Prompt window

Chapter 2 (30 slides) 12


2.12 Activity:
Working with Defaults
KEY CONCEPTS:
 “Shelling out to DOS”
 Using Default drive
 Determining drive to be searched
 Why DIR A: HELLO.TXT is a very clear request

Chapter 2 (30 slides) 13


2.12 Activity:
Working with Defaults
Your Turn…
1. Start/Programs/Accessories/Command Prompt
2. A:
3. DIR
4. DIR A:
5. C:
6. CD \
7. DIR A:
8. DIR HELLO.TXT
9. DIR A:HELLO.TXT

Chapter 2 (30 slides) 14


2.14 Activity:
Using Path with the DIR
Command
KEY CONCEPTS:
 Delimiter for path names
 Backslash (first and others)

Chapter 2 (30 slides) 15


2.14 Activity:
Using Path with the DIR
Command
Your Turn…
1. DIR A:
2. DIR A:\DATA
3. DIR A:\DATA\THIN.EST

Chapter 2 (30 slides) 16


2.16 Activity:
Changing the Default Drive
KEY CONCEPTS:
 Changing default
 Locating file not in default directory
 C:\ - major subdirectory

Chapter 2 (30 slides) 17


2.16 Activity:
Changing the Default Drive
Your Turn…
1. A:
2. DIR DISKCOPY.COM
3. DIR C:\DISKCOPY.COM
4. DIR C:\WINDOWS\SYSTEM32\DISKCOPY.COM

Chapter 2 (30 slides) 18


2.18 Activity:
Changing Directories
KEY CONCEPTS:
 Results of keying in
 CD alone - display current default directory
 CD followed by path - will change default directory
 CD \ - will always return to root directory

Chapter 2 (30 slides) 19


2.18 Activity:
Changing Directories
Your Turn…
1. C:
2. CD
3. CD \WINDOWS\SYSTEM32
4. DIR DISKCOPY.COM
5. CD \
6. CD /D A:\DATA
7. DIR
8. CD

Chapter 2 (30 slides) 20


2.20 Activity:
DIR and Wildcards
KEY CONCEPTS:
 Locating files with insufficient data
 Using * and *.*
 Using ? and ???
 Using *.SYS

Chapter 2 (30 slides) 21


2.20 Activity:
DIR and Wildcards
Your Turn…
1. C:
2. CD \WINDOWS\SYSTEM32
3. DIR G
4. DIR G*.*
5. DIR *.SYS
6. DIR A:\*.TXT

Chapter 2 (30 slides) 22


2.20 Activity:
DIR and Wildcards
Your Turn…
7. DIR A:\?????.TXT
8. DIR A:\EXP*.*
9. DIR A:\EXP01*.*
10. DIR A:\EXP??JAN.*
11. CD \

Chapter 2 (30 slides) 23


2.22 Activity: Redirecting
Output to a File
KEY CONCEPTS:
 Redirecting output to a file
 Redirection is “instead of” procedure
 Dealing with write-protected disks

Chapter 2 (30 slides) 24


2.22 Activity: Redirecting
Output to a File
Your Turn…
1. A:
2. DIR *.NEW
3. DIR *.NEW > MY.HW
4. DIR MY.HW

Chapter 2 (30 slides) 25


2.24 Activity:
Redirecting Output to the
Printer
KEY CONCEPTS:
 Can redirect computer output to a file or printer
 To redirect to printer need a local printer
 Printer device names: PRN, LPT1, LPT2 and sometimes
LPT3

Chapter 2 (30 slides) 26


2.24 Activity:
Redirecting Output to the
Printer
Your Turn…
1. DIR *.TXT
2. DIR *.TXT > PRN

Chapter 2 (30 slides) 27


2.26 Activity:
Getting Help with a Command
KEY CONCEPT:
 Results of DIR command with parameters:
? ON
O-N S
BLP B/L/P
E D

Chapter 2 (30 slides) 28


2.26 Activity:
Getting Help with a Command
Your Turn…
1. DIR /?
2. <CR>
3. DIR /ON
4. DIR /O-N
5. DIR /S
6. DIR /blp
7. DIR /B /L /P
8. Press <CR> until you reach the end of the display
9. EXIT
10. Initiate and complete Windows shut-down
Chapter 2 (30 slides) 29

You might also like