Examination Command-Line Systems Exam
Actual Exam 2026/2027 with Detailed
Rationales | Complete Exam-Style Questions |
Pass Guaranteed – A+ Graded
Section I: File Management Commands (15 Questions)
Q1: A technician needs to copy all files from C:\REPORTS to D:\BACKUP\REPORTS including empty
subdirectories, hidden files, and system files, while preserving all file attributes. Which command
accomplishes this in a single operation?
A. COPY C:\REPORTS\*.* D:\BACKUP\REPORTS /S /H /R /K
B. XCOPY C:\REPORTS\*.* D:\BACKUP\REPORTS /S /E /H /R /K
C. XCOPY C:\REPORTS\*.* D:\BACKUP\REPORTS /S /E /H /K [CORRECT]
D. COPY C:\REPORTS D:\BACKUP\REPORTS /S /V /H /K
Correct Answer: C
,Rationale: Correct because the XCOPY command in MS-DOS 6.22 with the /S switch copies
directories and subdirectories except empty ones, while /E includes empty subdirectories; /H
copies hidden and system files, and /K copies attributes. The /R switch is unnecessary since
XCOPY does not require it to overwrite read-only files by default in MS-DOS 6.22, and COPY
cannot copy directory structures recursively.
Q2: A user accidentally typed DEL C:\DATA\*.* and pressed Enter. The system responded with
All files in directory will be deleted! Are you sure (Y/N)? The user pressed Y.
Which command, if executed immediately afterward without writing any new files to the disk, offers
the best chance of recovering the deleted files?
A. UNFORMAT C: /U /L
B. UNDELETE C:\DATA\*.* /ALL /DOS
C. UNDELETE C:\DATA\*.* /ALL [CORRECT]
D. SCANDISK C: /AUTOFIX /NOSAVE
Correct Answer: C
Rationale: Correct because the UNDELETE command in MS-DOS 6.22 with the /ALL switch
recovers all deleted files in the specified directory without prompting, using the first available
character to replace the missing first character of each filename. The /DOS switch limits recovery to
standard DOS directory entries, which may miss files recoverable through other methods, and
UNFORMAT is inappropriate since the disk was not formatted.
Q3: A batch file needs to concatenate three text files—LOG1.TXT, LOG2.TXT, and LOG3.TXT—into
a single file named COMBINED.TXT in the current directory. Which command syntax is correct?
,A. COPY LOG1.TXT + LOG2.TXT + LOG3.TXT = COMBINED.TXT
B. COPY LOG1.TXT + LOG2.TXT + LOG3.TXT COMBINED.TXT /A
C. COPY LOG1.TXT+LOG2.TXT+LOG3.TXT COMBINED.TXT [CORRECT]
D. TYPE LOG1.TXT LOG2.TXT LOG3.TXT > COMBINED.TXT
Correct Answer: C
Rationale: Correct because the COPY command in MS-DOS 6.22 concatenates files when multiple
source files are separated by plus signs (+) with a destination file specified; the syntax COPY
LOG1.TXT+LOG2.TXT+LOG3.TXT COMBINED.TXT combines the three files in order into
COMBINED.TXT, overwriting any existing destination file.
Q4: A system administrator needs to display the contents of CONFIG.SYS one screen at a time.
Which command sequence is correct?
A. TYPE CONFIG.SYS > MORE
B. MORE < CONFIG.SYS [CORRECT]
C. TYPE CONFIG.SYS < MORE
D. DISPLAY CONFIG.SYS | MORE
Correct Answer: B
Rationale: Correct because the MORE filter in MS-DOS 6.22 displays output one screen at a time
when input is redirected from a file using the less-than operator (<<); the syntax MORE <
, CONFIG.SYS pipes the file contents into the MORE filter. The command TYPE CONFIG.SYS |
MORE is also valid, but among the choices provided, only option B uses correct redirection syntax.
Q5: Which ATTRIB command sets the hidden and system attributes on COMMAND.COM in the root
directory of drive C:?
A. ATTRIB C:\COMMAND.COM +H +S [CORRECT]
B. ATTRIB +H +S C:\COMMAND.COM
C. ATTRIB C:\COMMAND.COM /H /S
D. ATTRIB C:\COMMAND.COM =H =S
Correct Answer: A
Rationale: Correct because the ATTRIB command in MS-DOS 6.22 uses the syntax ATTRIB
[drive:][path]filename [+R|-R] [+A|-A] [+S|-S] [+H|-H]; the plus signs set attributes,
and the filename must follow the command name before or after the switches, but the standard
documented syntax places the filename first followed by attribute switches.
Q6: A technician needs to compare two binary files, DRIVER1.SYS and DRIVER2.SYS, and display
only the differences in hexadecimal format. Which FC command syntax is correct?
A. FC /B /A DRIVER1.SYS DRIVER2.SYS
B. FC DRIVER1.SYS DRIVER2.SYS /B /N
C. FC /B DRIVER1.SYS DRIVER2.SYS [CORRECT]