Name: 
 

cpt106DOSch08



Multiple Choice
Identify the letter of the choice that best completes the statement or answers the question.
 

1. 

By using __________ in your batch program, you guarantee that the command interpreter has access to program files stored in specific directories used by the Windows operating system.
a.
%SYSTEMROOT%
b.
%USERPROFILE%
c.
%PATH%
d.
%PATHEXT%
 

2. 

You can display a list of special codes to customize the DOS prompt by entering __________.
a.
PROMPT ?
b.
? PROMPT
c.
*/? PROMPT
d.
PROMPT /?
 

3. 

The MODE command is used to configure the
a.
keyboard.
b.
parallel ports.
c.
printer.
d.
All of the above
 

4. 

The syntax for the PROMPT command is: __________.
a.
PROMPT: text
b.
PROMPT--(text)
c.
PROMPT [text]
d.
None of the above
 

5. 

Normally, the command prompt displays the current drive letter and the full __________ of the current working directory.
a.
course
b.
path
c.
index
d.
parameter
 

6. 

The __________ command allows you to perform conditional tests within a batch program.
a.
WHEN
b.
IF
c.
FOR
d.
NEXT
 

7. 

The statement __________ attempts to switch to a subdirectory named "SolarWinds" or, if that fails, displays an error message.
a.
CD SolarWinds ^ ECHO No such directory
b.
CD SolarWinds && ECHO No such directory
c.
CD SolarWinds || ECHO No such directory
d.
CD SolarWinds & ECHO No such directory
 

8. 

The __________ statement creates a subdirectory named "Sullivan" first, and then switches to the "Sullivan" directory next.
a.
MD Sullivan (CD Sullivan)
b.
MD Sullivan & CD "Sullivan"
c.
MD Sullivan && CD Sullivan
d.
MD Sullivan || CD Sullivan
 

9. 

According to the __________ statement, if a subdirectory named "Microsoft" exists, a directory called "Presentations" is created.
a.
IF Microsoft\NUL (MD A:\Presentations)
b.
IF NOT NUL Microsoft (MD A:\Presentations)
c.
IF EXIST Microsoft\NUL (MD A:\Presentations)
d.
(MD A:\Presentations)IF EXIST Microsoft\NUL
 

10. 

When a batch program executes a GOTO command, it searches for another line that must consist of a __________ followed by the label you specify, and then the batch program executes the commands after that label line.
a.
colon
b.
semicolon
c.
hyphen
d.
dollar sign
 

11. 

Using a(n) __________ clause with an IF command allows you to specify an alternate command to execute when the condition is false.
a.
ELSE
b.
WHEN
c.
NEXT
d.
FOR
 

12. 

The __________ command takes a list of items and repeats the same operation or operations with each item in turn until it processes all the items in the list.
a.
WHILE
b.
NEXT
c.
FOR
d.
DO
 

13. 

A(n) __________ text string consists of a word or sequence of characters that is processed without treating any of the characters as a variable.
a.
relative
b.
absolute
c.
literal
d.
processed
 

14. 

Besides using wildcard filename matching patterns in the parentheses set of FOR /R, you may instead specify just a single
a.
comma.
b.
semicolon.
c.
colon.
d.
period.
 

15. 

The __________ switch is used by the FOR command to process lines of text inside a file, rather than just a list of words or filenames on the command line.
a.
/I
b.
/E
c.
/F
d.
/P
 

16. 

A(n) __________ is a program that is comparable to a batch program, but it is written in VBScript or JScript.
a.
index
b.
script
c.
extension
d.
applet
 

17. 

Which of the following is a use of a script?
a.
customizing user environments
b.
creating logon scripts
c.
updating the Windows registry
d.
All of the above
 

True/False
Indicate whether the sentence or statement is true or false.
 

18. 

You can use the || operator to change to a directory and then copy or back up files in that directory to another disk.
 
 
dosch08_files/i0210000.jpg
 

19. 

The first line in Figure 8-4 demonstrates the use of the & operator to execute two commands on a single command line.
 

20. 

The command, mode con: cols=300 lines=40, specifies the width of the window to 40 and the height of the window to 300.
 

21. 

You can use special codes with the Prompt command to customize the appearance of the DOS prompt.
 

22. 

You need quotation marks for a filename unless it contains spaces.
 

23. 

By not including @ECHO OFF in a batch program, you are able to view each command that the command interpreter executes when you invoke the batch program.
 

24. 

A string comparison tests whether two pieces of text are identical.
 

25. 

You can redirect the output of a file for e-mailing, printing, or additional processing.
 



 
Check Your Work     Reset Help