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?

link|improve this question

feedback

3 Answers

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%

link|improve this answer
feedback

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.

link|improve this answer
feedback

As it has always been done since DOS times:

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

Your Answer

 
or
required, but never shown

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