Printing from DOS to the Standard Printer Device Which DOS command correctly redirects the contents of REPORT.TXT to the standard printing device (PRN/LPT1)?

Difficulty: Easy

Correct Answer: TYPE REPORT.TXT > PRN

Explanation:


Introduction / Context:
DOS supports device names such as PRN, LPT1, and CON. Redirection and piping allow sending command output to devices or files. Printing from the command line without a dedicated print utility is often accomplished using redirection.


Given Data / Assumptions:

  • REPORT.TXT exists in the current directory or PATH.
  • PRN (or LPT1) is properly mapped to a working printer.
  • The TYPE command outputs file contents to standard output (the screen) by default.


Concept / Approach:
Redirection operator ">" sends standard output to a file or device. Thus, "TYPE filename > PRN" directs text output to the printer device instead of the console, effectively printing the file.


Step-by-Step Solution:
Use TYPE REPORT.TXT to confirm it displays on screen.Add redirection: TYPE REPORT.TXT > PRN.The printer receives the text stream and begins printing.


Verification / Alternative check:
Replace PRN with LPT1 if needed: TYPE REPORT.TXT > LPT1. If printing fails, verify printer setup or try PRINT command where available.


Why Other Options Are Wrong:
Option A uses non-DOS syntax.Options C and D misuse the pipe operator “|”, which connects programs via standard input/output, not directly to device names in this context.Option E is incorrect because Option B is valid and standard.


Common Pitfalls:

  • Using pipe instead of redirection for devices that are not programs.
  • Forgetting carriage control characters; plain text prints straightforwardly but large files may need pagination.


Final Answer:
TYPE REPORT.TXT > PRN

More Questions from Disk Operating System (DOS)

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion