All Products
Search
Document Center

:What do I do if the environment variables that are configured for a Windows Server instance do not take effect?

Last Updated:Mar 31, 2023

This topic describes the cause of the following issue and how to resolve the issue: The environment variables configured for an instance that runs Windows Server do not take effect.

Problem description

The PATH environment variable configured for an instance that runs Windows Server does not take effect. The issue has the following characteristics:

  • When you run the ping and ipconfig commands in Command Prompt, the following error message appears: "is not recognized as an internal or external command, operable program or batch file."

  • The PATH environment variables on the instance and on a normal host are the same.

  • The ping.exe file and other files are present in the C:\Windows\System32 directory.

  • In the actual test, the command that is written as PING.EXE can be run in Command Prompt, and an error is reported if the extension EXE is removed.

Cause

In normal cases, the commands can be run without the need to add extensions to the commands because the PATHEXT environment variable exists in the system. In this issue, the EXE extension is missing from the PATHEXT variable.

Solution

Perform the following operations:

  1. Connect to the Windows instance.

    For more information, see Connect to a Windows instance by using a password or key.

  2. Right-click My Computer and select Properties. In the left-side navigation pane, click Advanced system settings.

  3. Click Environment Variables. In the System variables section, add the .EXE to the PATHEXT value.

    Note

    After you modify the environment variable, start Command Prompt for the variable to take effect.