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. Deleting the system variable environment

    in Windows 10 Gaming
    Deleting the system variable environment: I unconsciously deleted all rows and items in the system variable environment setting in windows 11 and right now when I want to go for the Clean install of Windows 11 using installation media and click on the media creation tool in my flash memory, I face this error: "the...
  3. Deleting the system variable environment

    in Windows 10 Software and Apps
    Deleting the system variable environment: I unconsciously deleted all rows and items in the system variable environment setting in windows 11 and right now when I want to go for the Clean install of Windows 11 using installation media and click on the media creation tool in my flash memory, I face this error: "the...
  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. regarding path variable of user variable of environment variable

    in Windows 10 Customization
    regarding path variable of user variable of environment variable: please help me fast, I accidentally deleted path variable of user variable ..... I want to restore it. the real situation is I cannot run android studio project and it shows error - " unable to start daemon process............This problem might be caused by incorrect...
  8. 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....
  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. 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...