To open environment variables in Windows 11, press Windows + R, type sysdm.cpl, and press Enter. On the Advanced tab, select Environment Variables. You can also search the Start menu for Edit the system environment variables, which opens the same window.
These methods are described in a Microsoft Q&A answer. Environment variables point programs to important folders and settings, and that the Path variable tells Windows which folders to check when you run a command.
How to Open Environment Variables
Method 1: System Properties (user and system variables)
- Press Windows + R, or right-click Start and select Run.
- Type sysdm.cpl and select OK.
- Open the Advanced tab.
- Select Environment Variables at the bottom.
Result: The Environment Variables window opens. The answer on Microsoft Q&A notes this route lets you change both user and system variables. The top list holds variables for your account, and the bottom list, System variables, applies to every user on the PC. You may need administrator rights to change system variables.

Method 2: Start menu search
- Select Start and type environment.
- Choose Edit the system environment variables for both lists, or Edit environment variables for your account for only your own.
The Microsoft Q&A answer says the “for your account” option only lets you change user variables.
Method 3: Settings
- Press Windows + I to open Settings.
- Go to System > About.
- Click Advanced system settings.
- Select Environment Variables.
A shortcut to the same page: press Windows + X and choose System.
How to Edit the Path Variable
- In the Environment Variables window, select Path in the user or system list.
- Select Edit.
- Select New and paste the folder path, such as C:\Tools\bin.
- Select OK in each window.
Result: Windows adds the folder to the list it searches for programs. For example, adding a tool’s bin folder lets you run it from any folder. Restart the computer for the changes to take effect.

Java development is a practical example: JAVA_HOME identifies the JDK’s main folder, while Path lets Windows find commands in its bin folder. Our Java installation guide for Windows 11 explains how to choose the required version, configure those values, and check which installation your terminal is using.
How to Add a New Variable
Adding a variable works the same way as editing one. Select New under the user or system list, enter a Variable name and Variable value, and select OK. If a variable needs more than one value, separate the values with semicolons.
Check or Set Variables From the Command Line
- See your Path: in Command Prompt, run
echo %PATH%. - Temporary variable:
Setcreates a variable only for that Command Prompt window, and it’s gone when you close it. - Permanent variable:
Setxsaves a variable permanently. Use it carefully, and prefer the Environment Variables window for editing Path.
Be Careful
Changing environment variables can make your PC malfunction, so double-check before you add, edit, or delete one. Copy the old value into a text file before you change it, so you can put it back.
Frequently Asked Questions
Why can’t I edit system variables?
If you opened the “for your account” window, it only shows user variables, according to the Microsoft Q&A answer. Use sysdm.cpl instead to reach both lists.
Should I put a folder in the user Path or the system Path?
The system Path makes a tool available to all users on the PC, while the user Path only affects your account.
Related: How to Open the Run Command in Windows 11 and How to Install WSL2 on Windows 11.

Matthew Burleigh is the founder, head writer, and editor of Solve Your Tech, which he launched in 2012. He has written technology tutorials since 2008 and worked in IT since 2003, including small-business support, IT management, and consulting. He holds Bachelor’s and Master’s degrees in Computer Science from Arizona State University.
Matthew writes practical guides for Windows, iPhone and iPad, Microsoft Office, Outlook, Google apps, and Android. Solve Your Tech’s guides are tested on current devices or checked against official product documentation, with clear steps, sources, and update dates.
Read more about Matthew and how Solve Your Tech writes and updates its guides, or report a correction.