FORMAT May Incorrectly Return ERRORLEVEL of Zero (80224)



The information in this article applies to:

  • Microsoft MS-DOS operating system 5.0

This article was previously published under Q80224

SUMMARY

The MS-DOS FORMAT command may, under certain error conditions, return an ERRORLEVEL = 0 (zero), indicating successful completion, when in fact the format was unsuccessful.

Microsoft has confirmed this to be a problem in MS-DOS version 5.0. We are researching this problem and will post new information here as it becomes available.

MORE INFORMATION

When the FORMAT command is invoked with an invalid parameter in the command line, it may terminate with the appropriate error message, yet return an ERRORLEVEL of zero. This may produce undesired results in batch processing using the "IF ERRORLEVEL=" batch file command.

For example, the command

format a: /a

aborts with the error message "Invalid switch - /A", yet returns an ERRORLEVEL of 0 for batch processing.

Some other examples of FORMAT error conditions incorrectly returning an ERRORLEVEL of zero are as follows:

  • Cannot format an ASSIGNed or SUBSTed drive
  • Parameters not compatible with fixed disk
  • Parameter format not correct
  • Parameter value not allowed
  • Invalid drive specification
  • Required parameter missing
  • Too many parameters
  • Invalid Volume ID

Modification Type:MajorLast Reviewed:11/19/1999
Keywords:KB80224