How to Set Environment Variables in Windows 10

Also applicable to Windows 11 and Windows Server 2016/2019/2022.

The Good Old Way

  1. Press Win + e to open Windows Explorer.
  2. Right click on This PC in the left navigation panel or on the background, and click Properties.
  3. Click Advanced system settings.
  4. Click Environment Variables....
  5. 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.
  6. 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.

Back to Top | Home Page | GitHub | Email Me