Setting system level environment variables through a batch file or software package

We need to set system level environment variables and many XP systems. Also, we need to change them frequently. Is there an easier way to do it than typing them in manually? Is there a software package that can do it?
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

biggy_bConnect With a Mentor Commented:
You could try via cmd script.

"Using the add-on tool Setx.exe

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" "

This command-line tool offers a batch method for setting environmental variables in the user or system environment and requires no programming or scripting. In addition to taking an environmental variable and its associated value from the command line, it can also get the values of registrykeys and write them to text files.

Here is a python script here to accomplish that ->

As well you could try a registry approach

Environment variable

#define WM_WININICHANGE 0x001A
#define HWND_BROADCAST 0xffff


szKey = "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment";

//"Successfully Updated Environment Variable
// Flush the NT registry to all applications.
szEnv = "Environment";
pEnv = &szEnv;

Environment Variable Not Showing Until Reboot

You can do the registry manipulation probably, but realize you also need to call SendMessage to broadcast the settings change. This is really old school ISPro5 approach.

System Env data is stored at:

HKLM\SYSTEM \CurrentControlSet\Control\Session Manager\Environment

Forced accept.

EE Admin
All Courses

From novice to tech pro — start learning today.