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 and in guides from How-To Geek, Computer Hope, and Windows Report. How-To Geek explains that 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.
Windows Report describes this route, and Computer Hope gives 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. How-To Geek’s example adds a tool’s bin folder so you can run it from any folder. Computer Hope says to 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
How-To Geek says 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%, as Windows Report shows. - Temporary variable: Windows Report says
setcreates a variable only for that Command Prompt window, and it’s gone when you close it. - Permanent variable: Windows Report says
setxsaves a variable permanently. Use it carefully, and prefer the Environment Variables window for editing Path.
Be Careful
How-To Geek warns that 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?
How-To Geek says 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 has been writing tech tutorials since 2008. His writing has appeared on dozens of different websites and been read hundreds of millions of times.
After receiving his Bachelor’s and Master’s degrees in Computer Science he spent several years working in IT management for small businesses. However, he now works full time writing content online and creating websites.
His main writing topics include iPhones, Microsoft Office, Google Apps, Android, and Photoshop, but he has also written about many other tech topics as well.