Windows 10: Edit User and System Environment Variables in Windows

Discus and support Edit User and System Environment Variables in Windows in Windows 10 Tutorials to solve the problem; How to: Edit User and System Environment Variables in Windows How to Edit User and System Environment Variables in Windows Environment variables... Discussion in 'Windows 10 Tutorials' started by Scottyboy99, Dec 27, 2017.

  1. Edit User and System Environment Variables in Windows


    How to: Edit User and System Environment Variables in Windows

    How to Edit User and System Environment Variables in Windows


    Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. The variables can be used both in scripts and on the command line. Environment variables makes it easy when certain standard directories and parameters need to be referenced but where the actual locations or names can vary from computer to computer.

    The variable (ex: "%UserProfile%") is used as a type of shortcut of the value (ex: "C:\Users\<username>").

    There are two types of environment variables: user environment variables (set only for current user) and system environment variables (set for all users).

    This tutorial will show you how to edit user and system environment variables in Windows 7, Windows 8, and Windows 10.


    CONTENTS:
    • Option One: Edit User Environment Variables in Environment Variables
    • Option Two: Edit User Environment Variables in Command Prompt
    • Option Three: Edit User Environment Variables in PowerShell
    • Option Four: Edit User Environment Variables in Registry Editor
    • Option Five: Edit System Environment Variables in Environment Variables
    • Option Six: Edit System Environment Variables in Command Prompt
    • Option Seven: Edit System Environment Variables in PowerShell
    • Option Eight: Edit System Environment Variables in Registry Editor




    OPTION ONE [/i] Edit User Environment Variables in Environment Variables
    1. Open the Control Panel (icons view), and click/tap on the User Accounts icon.

    2. Click/tap on the Change my environment variables link on the left side, and close the User Accounts control panel window if you like. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    3. Select a variable you want to edit listed in the top User variables for <current user name> section, and click/tap on the Edit button. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    4. Make any changes you want to the variable name and variable value, and click/tap on OK. (see screenshot below)

    *note If you like, you could click/tap on the Browse Directory button to navigate to and select a directory to have its path entered for the variable value.

    If you like, you could click/tap on the Browse File button to navigate to and select a file to have its path entered for the variable value.


    Edit User and System Environment Variables in Windows [​IMG]

    5. When finished editing user variables, click/tap on OK to apply. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]






    OPTION TWO [/i] Edit User Environment Variables in Command Prompt
    1. Open a command prompt.

    2. Type the set command into the command prompt, press Enter, and make note of the user variable name (ex: "Downloads") you want to edit the value for. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    3. Type the command below into the command prompt, and press Enter. (see screenshot below)
    *Arrow setx [variable name] "[variable value]"

    *note Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you wanted to edit from step 2.

    Substitute [variable value] in the command above with the edited variable value (ex: "C:\Users\Brink\Downloads") you want.

    4. You can now close the command prompt if you like.


    Edit User and System Environment Variables in Windows [​IMG]






    OPTION THREE [/i] Edit User Environment Variables in PowerShell
    1. Open Windows PowerShell.

    2. Type the command below into PowerShell, press Enter, and make note of the user variable name (ex: "Downloads") you want edit the value for. (see screenshot below)
    *Arrow Get-ChildItem Env:


    Edit User and System Environment Variables in Windows [​IMG]

    3. Type the command below into PowerShell, and press Enter. (see screenshot below)
    *Arrow [Environment]::SetEnvironmentVariable("[variable name]","[variable value]","User")

    *note Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you wanted to edit from step 2.

    Substitute [variable value] in the command above with the edited variable value (ex: "C:\Users\Brink\Downloads") you want.

    4. You can now close Windows PowerShell if you like.


    Edit User and System Environment Variables in Windows [​IMG]






    OPTION FOUR [/i] Edit User Environment Variables in Registry Editor
    1. Press Win+R keys to open Run, type regedit into Run, and click/tap on OK to open Registry Editor.

    2. Navigate to the key below in the left pane of Registry Editor. (see screenshot below)
    *Arrow HKEY_CURRENT_USER\Environment


    Edit User and System Environment Variables in Windows [​IMG]

    3. If you want to edit a variable name, then:
    A) In the right pane of the Environment key in Registry Editor, right click or press and hold on the value name (ex: "Downloads") of the variable you want to edit for your account, and click/tap on Rename. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    B) Type a new variable name you want to use, and press Enter. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    4. If you want to edit a variable value, then:
    A) In the right pane of the Environment key in Registry Editor, double click/tap on the name (ex: "Downloads") of the variable name you want to edit the value data for. (see screenshot below step 2)

    B) Type a new variable value you want to use, and click/tap on OK. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    5. When finished editing user variables for your account, you can close Registry Editor if you like.





    OPTION FIVE [/i] Edit System Environment Variables in Environment Variables

    *note You must be signed in as an administrator to do this option.
    1. Open the Control Panel (icons view), and click/tap on the System icon.

    2. Click/tap on the Advanced system settings link on the left side, and close the System control panel window if you like. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    3. Click/tap on the Environment Variables button. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    4. Select a variable you want to edit listed in the bottom System variables section, and click/tap on the Edit button. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    5. Make any changes you want to the variable name and variable value, and click/tap on OK. (see screenshot below)

    *note If you like, you could click/tap on the Browse Directory button to navigate to and select a directory to have its path entered for the variable value.

    If you like, you could click/tap on the Browse File button to navigate to and select a file to have its path entered for the variable value.


    Edit User and System Environment Variables in Windows [​IMG]

    6. When finished editing system variables, click/tap on OK to apply. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    7. Click/tap on OK. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]






    OPTION SIX [/i] Edit System Environment Variables in Command Prompt

    *note You must be signed in as an administrator to do this option.
    1. Open an elevated command prompt.

    2. Type the set command into the elevated command prompt, press Enter, and make note of the system variable name (ex: "Downloads") you want to edit the value for. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    3. Type the command below into the elevated command prompt, and press Enter. (see screenshot below)
    *Arrow setx [variable name] "[variable value]" -M

    *note Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you wanted to edit from step 2.

    Substitute [variable value] in the command above with the edited variable value (ex: "%UserProfile%\Downloads") you want.

    4. You can now close the elevated command prompt if you like.


    Edit User and System Environment Variables in Windows [​IMG]






    OPTION SEVEN [/i] Edit System Environment Variables in PowerShell

    *note You must be signed in as an administrator to do this option.
    1. Open an elevated Windows PowerShell.

    2. Type the command below into PowerShell, press Enter, and make note of the system variable name (ex: "Downloads") you want edit the value for. (see screenshot below)
    *Arrow Get-ChildItem Env:


    Edit User and System Environment Variables in Windows [​IMG]

    3. Type the command below into the elevated PowerShell, and press Enter. (see screenshot below)
    *Arrow [Environment]::SetEnvironmentVariable("[variable name]","[variable value]","Machine")

    *note Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you wanted to edit from step 2.

    Substitute [variable value] in the command above with the edited variable value (ex: "%UserProfile%\Downloads") you want.

    4. You can now close the elevated Windows PowerShell if you like.


    Edit User and System Environment Variables in Windows [​IMG]






    OPTION EIGHT [/i] Edit System Environment Variables in Registry Editor
    1. Press Win+R keys to open Run, type regedit into Run, and click/tap on OK to open Registry Editor.

    2. Navigate to the key below in the left pane of Registry Editor. (see screenshot below)
    *Arrow HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment


    Edit User and System Environment Variables in Windows [​IMG]

    3. If you want to edit a variable name, then:
    A) In the right pane of the Environment key in Registry Editor, right click or press and hold on the value name (ex: "Downloads") of the variable you want to edit, and click/tap on Rename. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    B) Type a new variable name you want to use, and press Enter. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    4. If you want to edit a variable value, then:
    A) In the right pane of the Environment key in Registry Editor, double click/tap on the name (ex: "Downloads") of the variable name you want to edit the value data for. (see screenshot below step 2)

    B) Type a new variable value you want to use, and click/tap on OK. (see screenshot below)

    Edit User and System Environment Variables in Windows [​IMG]

    5. When finished editing system variables, you can close Registry Editor if you like.

    That's it,
    Shawn


    Related Tutorials

    :)
     
    Scottyboy99, Dec 27, 2017
    #1
  2. ustulo Win User

    Edit Environment Variables of Standard User Account

    In Windows 10, how can I set user-level (not system wide) environment variables for a standard user account? To clarify: I'm not talking about editing system environment variables. Also, just running the System app in Control Panel as admin won't work because
    that would set the environment variables for that admin user.

    When I go to Control Panel -> User Accounts, then click the "Change my environment variables" link in the left-hand action pane, nothing happens.

    If I go to the search box on the task bar and type "environment", then click "Edit environment variables for your account", nothing happens.

    Currently I have JAVA_HOME set to an incorrect value in my user account, which is a standard user not an admin. If I edit environment variables as admin, it does not show up in the system environment variables nor in the user environment variables (since
    the Administrator account is a different user).
     
    ustulo, Oct 27, 2019
    #2
  3. MCK
    mck Win User
    System environment variable won't stick


    Running Win10 Home on an Acer Spin 3, 64bit, i7cpu. I try to add a path to the system environment variables by:

    1. Control Panel > System > Advanced system settings > Advanced tab > Environment variables

    2. The "Environment Variables" window opens.
    3. In the "System Variables" pane I select "Path" and click the EDIT button.
    4. A list of the current system paths is displayed.
    5. I click the NEW button, browse to the path I want to add which is "C:\Python36-32" and click OK. The path "C:\Python36-32" is added to the list of current system paths.
    6. I click OK and am returned to the "Environment Variables" window.
    7. I click the "X" at the top right to close the "Environment Variables" window.

    Now if I click the "Environment Variables" button again (end of step-1) and repeat steps 2-4, the new path I added in step-5 is gone. IOW, adding a new path won't stick.

    What am I doing wrong?
     
  4. S.B.K Win User

    Edit User and System Environment Variables in Windows

    S.B.K, Oct 27, 2019
    #4
  5. ryanGus Win User
    How to edit the user path environment variable (not system path)

    I need to edit the user path environment variable (not the
    system path), but it doesn't seem possible in any way. I have edited the user path before on another computer running Windows 7 by right clicking My Computer --> Advanced System Settings --> Environment Variables --> and editing the user path in the
    top dialog box (not the system path in the bottom dialog box). I tried the same thing in Windows 10 but "path" doesn't show up in the user environment variables dialog box, only TEMP and TMP show up.

    I also tried searching for path after hitting the windows key and clicking "Edit environment variables for your account" but nothing happens when I click it. If I search for "path" when in Control Panel, I also get the option to click "Edit environment variables
    for your account" but again, nothing happens when I click it. I also tried running Regedit --> HKEY_CURRENT_USER --> Environment, but the same options of TEMP and TMP show up, with no "path" option. I have tried searching the web for hours trying to solve
    this problem but I can't find a solution. Is there any other way to change edit the user path? Is Microsoft actively trying to address this problem? I am running on Windows 10 version 1511 OS build 10586.104. I am the only user on this machine and I am the
    administrator.
     
    ryanGus, Oct 27, 2019
    #5
  6. m h g Win User
    Editing Environment Variables

    My question is specifically about editing USER environment variables. I know how to access the system's Environment Variables dialog from Advanced System Settings using an account which is a member of the Administrators group. However, Windows 10 doesn't
    let me do that from a standard user account. Also, the console command

    rundll32 sysdm.cpl,EditEnvironmentVariables

    doesn't work in Build 10565 for either administrator or standard accounts. Meaning, nothing happens. The Environment Variables dialog doesn't appear. Is this a known problem in this build? Is this a problem of my own making?
     
    m h g, Oct 27, 2019
    #6
Thema:

Edit User and System Environment Variables in Windows

Loading...
  1. Edit User and System Environment Variables in Windows - Similar Threads - Edit User System

  2. edit environment variable

    in Windows 10 Gaming
    edit environment variable: I am unable to edit environment variables on Windows 11 i have tried all the available ways to solve this but all in vain. including disabling UAC, accessing the direct edit environment variable option from startup, messing with the registry...
  3. edit environment variable

    in Windows 10 Software and Apps
    edit environment variable: I am unable to edit environment variables on Windows 11 i have tried all the available ways to solve this but all in vain. including disabling UAC, accessing the direct edit environment variable option from startup, messing with the registry...
  4. Environment Variables, User variables for System Admin

    in Windows 10 Gaming
    Environment Variables, User variables for System Admin: I was looking at the 'User variables for System Admin' one day and saw my name spelled '*****'. I didn't care for that name and without thinking changed the name. Now all my music, photos & docs are gone. How can I undo that already tried 'System Restore'?...
  5. Environment Variables, User variables for System Admin

    in Windows 10 Software and Apps
    Environment Variables, User variables for System Admin: I was looking at the 'User variables for System Admin' one day and saw my name spelled '*****'. I didn't care for that name and without thinking changed the name. Now all my music, photos & docs are gone. How can I undo that already tried 'System Restore'?...
  6. Environment Variables, User variables for System Admin

    in Windows 10 Network and Sharing
    Environment Variables, User variables for System Admin: I was looking at the 'User variables for System Admin' one day and saw my name spelled '*****'. I didn't care for that name and without thinking changed the name. Now all my music, photos & docs are gone. How can I undo that already tried 'System Restore'?...
  7. System Environment variables

    in Windows 10 Customization
    System Environment variables: Hello! I have been trying to run executable programs using command prompt since a long time, added the path names to the System and user environment variables as well. But it is not helping, the command prompt is unable to run any file except the inbuilds such as notepad....
  8. Need to edit user environment variables on Windows 10.

    in Windows 10 Customization
    Need to edit user environment variables on Windows 10.: Is it possible to edit user environment variables on Windows 10 Home 1809? Past procedures don't work and solutions found on internet don't work....
  9. User Environment Variable

    in Windows 10 Software and Apps
    User Environment Variable: Created an User Environment variable in Environment variable page in UI. It is seen in both UI and command prompt(Using set command). After restart it is not seen in command prompt when set command is used. Please help....
  10. Delete User and System Environment Variables in Windows

    in Windows 10 Tutorials
    Delete User and System Environment Variables in Windows: How to: Delete User and System Environment Variables in Windows How to Delete User and System Environment Variables in Windows Environment variables are a set of dynamic named values that can affect the way running processes will behave on a computer. The variables can...