Microsoft KB Archive/74464

= Pipe (|) After IF EXIST Fails =

Article ID: 74464

Article Last Modified on 11/16/2006

-

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

-



This article was previously published under Q74464



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 &quot; lost clusters in 1 chain,&quot; where  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 &quot;Microsoft MS-DOS User's Guide and Reference&quot; 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.

Additional query words: 6.22 5.00 5.00a 6.00 6.20 batch

Keywords: KB74464

-

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

© Microsoft Corporation. All rights reserved.