Microsoft KB Archive/72015

= Redirection of PRINT Does Not Redirect All Error Messages =

Article ID: 72015

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft MS-DOS 4.0 Standard Edition
 * Microsoft MS-DOS 4.01 Standard Edition
 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a
 * Microsoft MS-DOS 6.0 Standard Edition
 * Microsoft MS-DOS 6.2 Standard Edition
 * Microsoft MS-DOS 6.21 Standard Edition
 * Microsoft MS-DOS 6.22 Standard Edition

-



This article was previously published under Q72015



SUMMARY
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.



MORE INFORMATION
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:

Resident part of PRINT installed

PRINT Queue is empty

 Type the following at the MS-DOS prompt

print testfile.txt > savefile.txt

where TESTFILE.TXT and SAVEFILE.TXT have not yet been created. Press ENTER. The following is displayed on the screen:

File not found-C:\DOS\TESTFILE.TXT

 List the contents of SAVEFILE.TXT by typing the following at the MS-DOS prompt:

type savefile.txt

The following message appears:

PRINT queue is empty



Earlier versions of MS-DOS printed nothing to the screen. However, the following error message would appear in the SAVEFILE.TXT file:

File not found-C:\DOS\TESTFILE.TXT

PRINT queue is empty

The &quot;File not found-C:\DOS\TESTFILE.TXT&quot; 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

Additional query words: 6.22 4.00 4.01 4.01a 5.00 5.00a 6.00 6.20 6.21

Keywords: KB72015

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.