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:

    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 "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: Major Last Reviewed: 5/12/2003
Keywords: KB72015