Windows Tools

Setx.exe: Set Environment Variables

Overview | Notes | Syntax | Related Tools Open Command Prompt

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.

Notes

Corresponding UI

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.

Concepts

For more information on environment variables, see Setting environment variables or Using environment variables to manage workstations in the Help and Support Center.

System Requirements

The following are the system requirements for SetX:

File Required