Setting a system environment variable from a Windows batch file? -


Is it possible to set an environment variable at the system level from the command prompt in Windows 7 (or XP for that matter) . I'm running with an advanced command prompt.

When I use the set command ( set name = value ), then the environment variable appears to be valid for the session of the command prompt. .

XP support tool (which can be installed from your XP CD) setx. Exe comes with a program called :

  c: \ program files \ support tool & gt; Setx /? SETX: This program is used to set the value in machine environment or to log on to the user using one of the three ways at present. 1) Command Line Mode: SetX Variable Value [-M] Optional Switches: -Modet value set in the machine environment. The default user is ... For more information and examples use: SETX -i  

I think that Windows 7 is actually part of a standard install as setx < Comes with / code>.


Comments