How to edit environment variables in Windows 10

Environment variables are values that contain all the information regarding the system environment. Every process within the Windows OS has a block that contains a set of environment variables and their values. There are two kinds of environment variables, namely User Environment Variables and System Environment Variables. As the name suggests, user environment variables are set for each user, while system environment variables apply to everyone using the system.

Any user working with the command prompt or batch scripts will be well aware of environment variables due to the repetition of values. Every environment variable has two parameters: name and value. Therefore, you can edit or create your own environment variables to make your work easier. In this guide, I will discuss the ways to edit environment variables in Windows 10.

Editing Environment Variables.

In order to edit environment variables, follow the steps below to access them.

Navigating to Environment Variables Using the Command Prompt:

1. If you want to have access to both the variables, i.e., user and system variables, then open an elevated Command Prompt by right-clicking on the Start Menu icon and selecting Command Prompt (Admin) from the list.

2. While inside the command prompt, type or copy/paste the following command provided below. You can paste the command by right-clicking inside the Command Prompt and selecting ‘Paste.’ Press the Enter key to execute the command.

environment variables1

Command:    rundll32.exe sysdm.cpl,EditEnvironmentVariables

3. After pressing Enter, the Environment Variables window will pop up, featuring a section for User Variables and another for System Variables.

environment variables2

4. To edit a variable, select the desired variable and press the Edit button to change its name. After making adjustments, press OK.

environment variables3

5. If you want to create a new environment variable for yourself, then click on the “New” button, and type the name and value for that particular variable, followed by clicking “OK.
environment variables4

Navigating to Environment Variables Manually.

1. Press the Win + X keys on the keyboard and select ‘System’ from the list.

2. Inside the System window, click on Advanced System Settings located in the left pane.

environment variables5

3. Within the advanced system settings, click on the Environment Variables button at the bottom, and follow the same procedure to edit environment variables as described above.

environment variables6

ABOUT THE AUTHOR

Kevin Arrows


Kevin Arrows is a highly experienced and knowledgeable technology specialist with over a decade of industry experience. He holds a Microsoft Certified Technology Specialist (MCTS) certification and has a deep passion for staying up-to-date on the latest tech developments. Kevin has written extensively on a wide range of tech-related topics, showcasing his expertise and knowledge in areas such as software development, cybersecurity, and cloud computing. His contributions to the tech field have been widely recognized and respected by his peers, and he is highly regarded for his ability to explain complex technical concepts in a clear and concise manner.

Comments

5
    TJ
    TJShoemaker Mar 3, 2016

    I am on Windows 10 and getting an error message with Outlook and Word ”

    Outlook/Word “could not create the work file – check the temp environment variable”.

    I am able to navigate to my environment variables manually, but what do I do to fix this error?

      KA
      K. Arrows Author Mar 4, 2016

      Follow the steps given below at our own risk. Set a restore point before you do this. Making a mistake in the registry can have bad results

      In your registry HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrent VersionExplorerUser Shell FoldersCache the data value for Cache should be %USERPROFILE%Local SettingsTemporary Internet Files. Close all open programs. Then in the registry editor, once you get to the folder listed above, right click on “Cache”, left click on “Modify”, paste in “%USERPROFILE%Local SettingsTemporary Internet Files” (without the quotes), left click “Ok” close the registry editor. Restart the PC. This should resolve your issue.

    SA
    sai Aug 15, 2020

    Under system variables, all buttons are disabled on my system. I am logged in as administrator. How to enable those buttons so that I can create new system variables ? Please help

      SW
      Shane Warren Author Aug 15, 2020

      Which version of Windows are you on? Are on PRO or Home?

    DP
    Delphi Programmer Dec 10, 2022

    Note**. This command is case sensitive. You cannot type “rundll32.exe sysdm.cpl,editenvironmentvariables.” That will just spit out an error. Normally Windows commands are not case sensitive, but in this case it is.