Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

Possible Duplicate:
Setting and getting windows environment variables from the command prompt?

Is there any way to set permanently set an environment variable system wide from the command line in Windows?

something like

>systemset newVar=foo

or a file to edit would work well too.

share|improve this question

marked as duplicate by BinaryMisfit Oct 15 '11 at 11:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

up vote 8 down vote accepted

You can use the MS utility "Setx" to make permanent changes form the command-line.

Here's a direct link to the Windows 2000 version (works in XP, etc.).

You can also get it in the Windows XP SP2 Support Tools pack.

It is not part of the standard Windows XP setup but a command-line tool called setx.exe is included in the Windows XP Service Pack 2 Support Tools. This tool extends the set command so that permanent changes in the environment variables can be made. For example, to add a folder C:\New Folder to the path, the command would be setx path "%PATH%;C:\New Folder"

share|improve this answer
It's part of Windows since at least Vista, though. – Joey Mar 14 '10 at 19:05
Good point, forgot to mention that. :) – Ƭᴇcʜιᴇ007 Mar 14 '10 at 19:22
It is possible to do the same from System Properties > Advanced > Environment Variables, or registry HKCU\Environment. – grawity Mar 15 '10 at 14:52

Not the answer you're looking for? Browse other questions tagged .