Microsoft KB Archive/83273

= Err Msg: &quot;Specified COMMAND Directory Bad&quot; =

Article ID: 83273

Article Last Modified on 11/16/2006

-

APPLIES TO


 * Microsoft MS-DOS 5.0 Standard Edition
 * Microsoft MS-DOS 5.0a

-



This article was previously published under Q83273



SUMMARY
The following error message will occur if incorrect parameters are used with COMMAND.COM, or an invalid COMSPEC is being set:

Specified COMMAND Search Directory Bad

This error will occur in MS-DOS and in the Windows operating system when COMMAND.COM is used incorrectly in a .PIF (program information file).



MORE INFORMATION
The following examples illustrate how the error may be caused in Windows 3.x and MS-DOS:

Windows 3.x
  The error will be received if running an MS-DOS application as a parameter of COMMAND.COM without the /C option. The format of the Optional Parameters line in the .PIF should read as follows:      Optional Parameters:   /c [drive]\[dir]\PROGRAM.EXE   The error message may occur when associating a data file with a .PIF that invokes COMMAND.COM with the /C option, using PIF Editor. For example:      Program Filename:    COMMAND.COM Window Title:       Test Optional Parameters: /c foot.exe Start-up Directory: c:\ To associate the data file (TEST.JNK) with this .PIF, put the associated file to the right of the Optional Parameters: /C option, as follows      Optional Parameters: /c foot.exe test.jnk rather than:      Optional Parameters: test.jnk /c foot.exe 

MS-DOS
 If you type command at a command prompt with incorrect options, the error message

Specified COMMAND search directory bad

will be displayed. After receiving this message, the PATH, PROMPT, and other environment variables will be lost because a new environment is being set. Type exit to reset the initial environment.  If there is an incorrect COMSPEC variable or no COMSPEC variable in the SHELL statement of the CONFIG.SYS file, the error message

Cannot Find COMMAND.COM

may be displayed when exiting an application, or the error message

Specified Command Search Directory Bad

may be displayed on startup. The error message will occur as the COMSPEC variable is attempting to set.

To correct the error, make sure that the CONFIG.SYS file contains the line: <pre class="fixed_text">     shell=[drive]\[dir]\command.com [drive]\[dir]\ /p (Where [drive] refers to the drive that contains the MS-DOS directory and files or the drive that contains COMMAND.COM, and [dir] refers to the appropriate MS-DOS directory that contains COMMAND.COM.)

Make sure to use correct syntax with COMMAND.COM. For more information on proper syntax, see the &quot;Microsoft MS-DOS User's Guide and Reference&quot; version 5.0 manual. </li></ul>

Additional query words: 5.00 5.00a

Keywords: KB83273

-

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

© Microsoft Corporation. All rights reserved.