Windows 10: Delete User and System Environment Variables in Windows

Discus and support Delete User and System Environment Variables in Windows in Windows 10 Tutorials to solve the problem; How to: Delete User and System Environment Variables in Windows How to Delete User and System Environment Variables in Windows Environment... Discussion in 'Windows 10 Tutorials' started by jameswesthead, Oct 22, 2017.

  1. 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 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 delete user and system environment variables in Windows 7, Windows 8, and Windows 10.


    CONTENTS:
    • Option One: Delete User Environment Variables in Environment Variables
    • Option Two: Delete User Environment Variables in PowerShell
    • Option Three: Delete User Environment Variables in Registry Editor
    • Option Four: Delete System Environment Variables in Environment Variables
    • Option Five: Delete System Environment Variables in PowerShell
    • Option Six: Delete System Environment Variables in Registry Editor




    OPTION ONE [/i] Delete 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)

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

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

    4 When finished deleting user variables for your account, click/tap on OK to apply.


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






    OPTION TWO [/i] Delete 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 to delete. (see screenshot below)
    Get-ChildItem Env:


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

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

    Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you want to delete.

    4 You can now close Windows PowerShell if you like.


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






    OPTION THREE [/i] Delete 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)
    HKEY_CURRENT_USER\Environment


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

    3 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 delete for your account, and click/tap on Delete. (see screenshot above)

    4 Click/tap on Yes to confirm. (see screenshot below)

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

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





    OPTION FOUR [/i] Delete System Environment Variables in Environment Variables
    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)

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

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

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

    4 Select a variable you want to delete listed in the bottom System variables section, and click/tap on the Delete button. When finished deleting system variables, click/tap on OK to apply. (see screenshot below)

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

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

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






    OPTION FIVE [/i] Delete System Environment Variables in PowerShell
    You must be signed in as an administrator to do this option.


    1 Open an elevated Windows PowerShell.

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


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

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

    Substitute [variable name] in the command above with the actual variable name (ex: "Downloads") you want to delete.

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


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






    OPTION SIX [/i] Delete System Environment Variables in Registry Editor
    You must be signed in as an administrator to do this option.


    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)
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment


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

    3 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 delete, and click/tap on Delete. (see screenshot above)

    4 Click/tap on Yes to confirm. (see screenshot below)

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

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

    That's it,
    Shawn


    Related Tutorials

    :)
     
    jameswesthead, Oct 22, 2017
    #1
  2. 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?
     
  3. Kapil Arya MVP, Oct 27, 2019
    #3
  4. Jose Est Win User

    Delete User and System Environment Variables in Windows

    User environment variables recovery

    Hi Haoran,

    The system environment block represents environment variables for all users of the particular computer. A user's environment block represents the environment variables the system maintains for that particular user, including the set of system environment
    variables.

    That being said, there might have been a conflict with your user environment variables after renaming your PC.

    To have your user environment variables issue addressed, we highly recommend posting it to our
    TechNet Forum which caters IT professionals who are actively answering these types of concerns. Click
    here to post your issue.

    If you have other concerns, don't hesitate to get back to us.
     
    Jose Est, Oct 27, 2019
    #4
  5. Delete User Environment Variables in Environment Variables

    You can also easily delete variables from the command prompt:

    setx VariableName ""

    set VariableName=

    reg delete HKCU\Environment /v VariableName

    reg delete "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment" /v VariableName /f


    * set: changes made by set are only until you close the command prompt

    * setx: after deleting a variable with setx you may have to close and reopen the command prompt for changes to be noticed

    * reg delete: you have to close and open another cmd for changes to be noticed
     
    ricardobohner, Oct 27, 2019
    #5
  6. 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
    #6
Thema:

Delete User and System Environment Variables in Windows

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

  2. Help with environment variables

    in Windows 10 Customization
    Help with environment variables: A while back, I made some changes to my environment variables (not realizing this was a bad idea), and Path system variable had system 32 removed (as well as others). This has caused me issues running commands from CMD, however, even after adding the path back and restarting,...
  3. 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....
  4. Environment Variables

    in Windows 10 BSOD Crashes and Debugging
    Environment Variables: what will happen if i accidentally delete one of those environment variables without realizing it ? and how to fix it ? https://answers.microsoft.com/en-us/windows/forum/all/environment-variables/fedbdf36-ce8e-4861-a775-1dc62dd1c67e
  5. environment variables missing

    in AntiVirus, Firewalls and System Security
    environment variables missing: i also got error message 80007000cb https://answers.microsoft.com/en-us/protect/forum/protect_defender-protect_updating-windows_10/environment-variables-missing/dad217b7-71e5-47d8-8569-4ab5e6380287
  6. Edit User and System Environment Variables in Windows

    in Windows 10 Tutorials
    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...
  7. Set New User and System Environment Variables in Windows

    in Windows 10 Tutorials
    Set New User and System Environment Variables in Windows: How to: Set New User and System Environment Variables in Windows How to Set New 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...
  8. i accidently deleted system environment variable path

    in Windows 10 Support
    i accidently deleted system environment variable path: i accidently deleted the system environment variable path value now i cant run my java or while typing javac in CMD itit shows javac is not recognized as an internal or external command, operable program or batch file." please tell how do i get the real path 70122
  9. Deleted Environment Variables in Windows 10

    in Windows 10 Support
    Deleted Environment Variables in Windows 10: I think i accidentally deleted some system variables in my windows 10 OS. What are the defaults variables and their values. Need Help This is my variables [img] and i found a post in your forum Environment Variables in Windows 10 - Windows 10 Forums So think i...
  10. System environment variable won't stick

    in Windows 10 Support
    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...