This command-line tool offers administrators a batch method for
setting environment variables in the user or system environment and
requires no programming or scripting. In addition to taking an
environment variable and its associated value from the command
line, it can also get the values of registry keys and
write them to text files.
You can use SetX to set values for user and system environment
variables from one of three sources: Command Line Mode, Registry
Mode, or File Mode.
SetX provides the only command-line or programmatic way to
directly set system environment values for Microsoft
Windows XP. System environment variables can be manually
configured by using Control Panel or by using a registry editor
(Regedit). The Set
command (which is part of the Windows operating system) only uses
environment variables for the current console window.