Pipe (|) After IF EXIST Fails

Article ID: 74464 - View products that this article applies to.
This article was previously published under Q74464
Expand all | Collapse all

SUMMARY

There is a known problem with the pipe (|) command that causes the pipe to fail when used after an IF EXIST statement. For example, the command
IF EXIST c:\dos\readme.txt TYPE c:\dos\readme.txt | MORE
normally displays the contents of C:\DOS\README.TXT one screen at a time. When this command is issued under MS-DOS 5.0, 6.0, or 6.2 no information is displayed and you are returned to the prompt, even though the file exists.

In addition, this command results in File Allocation Table (FAT) corruption on the drive that the TEMP environment variable is pointing to or on the current drive if no TEMP variable has been set. Running CHKDSK after this command shows there are "<x> lost clusters in 1 chain," where <x> is dependent upon the size of the file being processed by the pipe. (The number of lost clusters and chains might be larger if there was additional FAT corruption prior to using the pipe.) The FAT corruption caused by this command does not result in data loss, and you can use CHKDSK with the /F switch to correct the corruption.

Please refer to the "Microsoft MS-DOS User's Guide and Reference" for more information on the use of the CHKDSK command.

Microsoft has confirmed this to be a problem in MS-DOS versions 5.00, 5.00a, 6.00, 6.20, 6.21, and 6.22. We are researching this problem and will post new information here as it becomes available.

Properties

Article ID: 74464 - Last Review: November 16, 2006 - Revision: 2.1
APPLIES TO
  • 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
Keywords: 
KB74464
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback