Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Fairly straightforward question. I need to update my PATH environment variable in Windows Server 2008 Core. Considering there's no GUI, how is this done from the command line?

share|improve this question
up vote 1 down vote accepted

from the Mueller book Administering Windows Server 2008 core - use WMIC

WMIC Environment Where Name="Path" SET VariableValue="C:\Temp;%PATH%

share|improve this answer

To make persistent changes use setx.

For example, to add a folder to the end of the current path, use:

SETX Path %Path%;C:\MyFolder

Your change won't be visible in the current cmd.exe session, but it will be in all future ones.

SETX also allows setting system environment variables on remote systems.

share|improve this answer
Add /M to set a system wide environment variable. The default behaviour is to set a variable in the current user environment. – TimT May 31 '13 at 13:53

As it has always been done since DOS times:

SET PATH = C:\SomeDir
SET PATH = %PATH%;C:\AnotherDir
share|improve this answer
These changes will not persist after the current process exits. – Richard Oct 2 '09 at 8:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.