Executable File Does Not Run from the Command Prompt in Windows NT

ID: Q246766


The information in this article applies to:
  • Microsoft Windows NT Server version 4.0
  • Microsoft Windows NT Workstation version 4.0

IMPORTANT: This article contains information about editing the registry. Before you edit the registry, make sure you understand how to restore it if a problem occurs. For information about how to do this, view the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

SYMPTOMS

When you attempt to run an executable file or a batch file from the command prompt on a computer running Microsoft Windows NT Server 4.0 or Windows NT Workstation 4.0, the file may not run. When you then attempt to run the executable file from the Autoexec.bat file, using the %pathext% variable, the file still may not run.


CAUSE

This behavior can occur when a value is missing from the following registry key:


HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
 Manager\Environment 


RESOLUTION

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.

For information about how to edit the registry, view the "Changing Keys and Values" Help topic in Registry Editor (Regedit.exe) or the "Add and Delete Information in the Registry" and "Edit Registry Data" Help topics in Regedt32.exe. Note that you should back up the registry before you edit it. If you are running Windows NT, you should also update your Emergency Repair Disk (ERD).

To resolve this issue, add the pathext value to the Environment key in the registry:

  1. Start Registry Editor (Regedt32.exe) and locate the following key:


  2. 
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session
     Manager\Environment 
  3. Add the value to the registry key:


    1. On the Edit menu, click Add Value.


    2. In the Value Name box, type the following:
      PATHEXT=.COM;.EXE;.CMD;.BAT
      NOTE: Add any extensions that need to be executable.


    3. In the Data Type list, click REG_SZ, and then click OK.


  4. Quit Registry Editor, and then restart the computer.


Additional query words: com exe bat

Keywords :
Version : winnt:4.0
Platform : winnt
Issue type : kbprb


Last Reviewed: November 23, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.