How to Set Environment Variables in Windows 10
Also applicable to Windows 11 and Windows Server 2016/2019/2022.
The Good Old Way
- Press Win + e to open Windows Explorer.
- Right click on This PC in the left navigation panel or on the background, and click Properties.
- Click Advanced system settings.
- Click Environment Variables....
- Click New. There are two groups of buttons. The above one is for current user, while the below one affects all users using the PC.
- Enter the name and value of the new variable, and then click OK.
The Nerdy Way
Press Win + r, enter rundll32.exe sysdm.cpl,EditEnvironmentVariables
and press Enter.
Note that pressing Enter will run a task with user privilege, where you can only change settings for current user. Press Ctrl + Shift + Enter instead to run it as administrator.