Microsoft KB Archive/77632

= Trailing Spaces in SET TEMP Returns Error in MS-DOS Shell =

Article ID: 77632

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

-



This article was previously published under Q77632



SYMPTOMS
You may receive the following error message when you try to invoke an executable file from MS-DOS Shell:

BAD COMMAND OR FILENAME

SHIFT+F9 works properly, but program items, the Run command on the File menu, and choosing an executable from the file list do not work.



CAUSE
These symptoms occur if the SET TEMP= statement in your AUTOEXEC.BAT file contains one or more trailing blank spaces as the last character(s). For example, in the statement   set temp=c:\tempdir any blank space(s) after the letter &quot;r&quot; in &quot;tempdir&quot; cause the above error. This error occurs if the TEMP variable containing the trailing space is set to any directory other than the root.

The error message is displayed if an executable file is invoked by any of the following methods:


 * Pressing ENTER or double-clicking a program listed in the program list of the Main group.
 * Pressing ENTER or double-clicking the executable filename under the file list.
 * Choosing Run from the File menu and entering the executable file name on the command line.



WORKAROUND
To determine if this is the problem, exit Shell, and enter the following command at the MS-DOS command prompt:   set temp=c:\ This command sets the temporary directory to the root. Start Shell, then invoke the executable file by using one of the above methods.

If this corrects the problem, remove any trailing blanks on the SET TEMP= line in the AUTOEXEC.BAT file.

Additional query words: 5.00 6.00 dosshell doshell

Keywords: KB77632

-

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

© Microsoft Corporation. All rights reserved.