Redirection of PRINT Does Not Redirect All Error Messages (72015)
The information in this article applies to:
• Microsoft MS-DOS operating system 4.0
• Microsoft MS-DOS operating system 4.01
• Microsoft MS-DOS operating system 5.0
• Microsoft MS-DOS operating system 5.0a
• Microsoft MS-DOS operating system 6.0
• Microsoft MS-DOS operating system 6.2
• Microsoft MS-DOS operating system 6.21
• Microsoft MS-DOS operating system 6.22
This article was previously published under Q72015
When the MS-DOS PRINT command is issued and redirected to a file, error
messages (if any) are not always directed to the specified file.
The distinction between which errors are and are not redirected in MS-DOS
might be between an error message as opposed to a status message. An error
message is considered important and, therefore, is always directed to the
screen, whereas a status message can be read later with no harm done.
To re-create this behavior, do the following:
• Set up the print queue by typing PRINT at the MS-DOS prompt.
• Specify the printer port you are using. The following message will
appear on the screen:
• Type the following at the MS-DOS prompt
where TESTFILE.TXT and SAVEFILE.TXT have not yet been created.
print testfile.txt > savefile.txt
• Press ENTER. The following is displayed on the screen:
• List the contents of SAVEFILE.TXT by typing the following at the
The following message appears:
Earlier versions of MS-DOS printed nothing to the screen. However, the
following error message would appear in the SAVEFILE.TXT file:
The "File not found-C:\DOS\TESTFILE.TXT" error message is directed to
different places in the different versions. This is only one example.
This also occurs with the COPY command. For more information, query on
the following words here in the Microsoft Knowledge Base:
redirection and copy and command
| Modification Type:
|| Last Reviewed: