How do I change environment variables in regular User account???

Page 1 of 2 12 LastLast

  1. Posts : 414
    Windows 10 Pro
       #1

    How do I change environment variables in regular User account???


    (The number of primitive bugs in version 1511 is just imagination-defying.)

    Open Control Panel. Open User Accounts applet. On the left there's a link that says Change my environment variables.

    How do I change environment variables in regular User account???-var.png

    Clicking on that link... does nothing (!!!). The link is simply dead.

    What on Earth is going on??? How are we supposed to change environment variables in non-Administrator accounts now? This Change my environment variables link in User Accounts was provided specifically for that purpose. There's no other natural way to do it.

    I know that there are workarounds for this (all ugly), but... WTH? Did they do even basic testing on this 1511 release???

    P.S. Just confirmed that pre-1511 Windows 10 works normally in that regard. This damage was done specifically by 1511 update.
    Last edited by AndreyT; 18 Nov 2015 at 13:52.
      My Computer


  2. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #2

    Right click on This PC and select Properties.
    Click on Advanced system settings on the left.
    Enter the password for your administrator level account.

    Now you can change environment variables.

    Don't know why doing it through Control Panel doesn't also prompt you for administrator credentials, it should.
      My Computers


  3. Posts : 414
    Windows 10 Pro
    Thread Starter
       #3

    Ztruker said:
    Right click on This PC and select Properties.
    Click on Advanced system settings on the left.
    Enter the password for your administrator level account.

    Now you can change environment variables.
    No, you can't.

    By using this method you will gain access to system-wide environment variables and to user-specific environment variables of the administrator, whose password you just entered. This is what you will edit there.

    I don't want to edit administrator's variables.

    I want to edit user-specific environment variables of my current non-admin user. There's no other direct way to do it besides going through the Control Panel, as I described above. The link in User Accounts exists specifically for that purpose.

    The reason it doesn't ask you for password is exactly that: this method will allow a non-admin user to edit their own user-specific environment variables only and nothing else.

    One more time: this issue is specifically and exclusively about the top part of the environment editor window

    How do I change environment variables in regular User account???-env.png
    Last edited by AndreyT; 19 Nov 2015 at 14:28.
      My Computer


  4. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #4

    Okay, agree you can change user and system wider variables, but at least you can change user specific variables there, just don't mess with the system stuff.

    I know it's not a fix and there is definitely a problem but at least this allows you to do what you need to do.

    Have you reported this to Microsoft via the Windows Feedback option?
      My Computers


  5. Posts : 414
    Windows 10 Pro
    Thread Starter
       #5

    Ztruker said:
    Okay, agree you can change user and system wider variables, but at least you can change user specific variables there, just don't mess with the system stuff.

    I know it's not a fix and there is definitely a problem but at least this allows you to do what you need to do.
    Sigh... No, it doesn't allow me to do what I need to do. My previous message has a very detailed explanation of why your "Advanced system settings" approach is not even close to what I need to do.

    One more time: I need to edit user-specific variable of a non-admin user, say, Alice. The approach suggested by you will allow me to edit user-specific variables of user Admin​ instead. Even if you are currently logged in as Alice, your "Advanced system settings" approach will take you to the user-specific variables for Admin. Are you aware of that little detail?

    Do you see the problem? I want to edit variables for Alice. Alice, Alice, Alice specifically. Not Admin. Alice. You suggestion cannot and will not edit Alice. Your suggestion will edit Admin. See the problem?

    If something is still not clear to you - feel free to ask.

    And yes, I reported this problem to Microsoft. They acknowledged the bug, asking me to create a Feedback entry, while they are creating their own entry from their end.
    Last edited by AndreyT; 19 Nov 2015 at 22:57.
      My Computer


  6. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #6

    Okay, I do see it now. Sorry for the thick headedness

    If we knew what clicking on that link was supposed to launch then we'd have a chance to make it work but as it stands, I don't see any way to fix it.

    As a work around, maybe this can work?

    HowTo: Set an Environment Variable in Windows - Command Line and Registry

    Set Environment Variables

    To set persistent environment variables at the command line, we will use setx.exe. It became part of Windows as of Vista/Windows Server 2008. Prior to that, it was part of the Windows Resource Kit. If you need the Windows Resource Kit, see Resources at the bottom of the page.

    setx.exe does not set the environment variable in the current command prompt, but it will be available in subsequent command prompts.
    Code:
    SetX has three ways of working: 
    
    Syntax 1:
        SETX [/S system [/U [domain\]user [/P [password]]]] var value [/M]
    
    Syntax 2:
        SETX [/S system [/U [domain\]user [/P [password]]]] var /K regpath [/M]
    
    Syntax 3:
        SETX [/S system [/U [domain\]user [/P [password]]]]
             /F file {var {/A x,y | /R x,y string}[/M] | /X} [/D delimiters]
    
    Description:
        Creates or modifies environment variables in the user or system
        environment. Can set variables based on arguments, regkeys or
        file input.
    
    Parameter List:
        /S     system          Specifies the remote system to connect to.
    
        /U     [domain\]user   Specifies the user context under which
                               the command should execute.
    
        /P     [password]      Specifies the password for the given
                               user context. Prompts for input if omitted.
    
        var                    Specifies the environment variable to set.
    
        value                  Specifies a value to be assigned to the 
                               environment variable.
    
        /K     regpath         Specifies that the variable is set based
                               on information from a registry key.
                               Path should be specified in the format of
                               hive\key\...\value. For example,
                               HKEY_LOCAL_MACHINE\System\CurrentControlSet\
                               Control\TimeZoneInformation\StandardName.
    
        /F     file            Specifies the filename of the text file
                               to use.
    
        /A     x,y             Specifies absolute file coordinates
                               (line X, item Y) as parameters to search 
                               within the file.
    
        /R     x,y string      Specifies relative file coordinates with
                               respect to "string" as the search parameters.
    
        /M                     Specifies that the variable should be set in
                               the system wide (HKEY_LOCAL_MACHINE)
                               environment. The default is to set the
                               variable under the HKEY_CURRENT_USER 
                               environment.
    
        /X                     Displays file contents with x,y coordinates.
    
        /D     delimiters      Specifies additional delimiters such as ","
                               or "\". The built-in delimiters are space,
                               tab, carriage return, and linefeed. Any 
                               ASCII character can be used as an additional
                               delimiter. The maximum number of delimiters,
                               including the built-in delimiters, is 15.
    
        /?                     Displays this help message.
    
    NOTE: 1) SETX writes variables to the master environment in the registry.
    
          2) On a local system, variables created or modified by this tool
             will be available in future command windows but not in the
             current CMD.exe command window.
    
          3) On a remote system, variables created or modified by this tool
             will be available at the next logon session.
    
          4) The valid Registry Key data types are REG_DWORD, REG_EXPAND_SZ,
             REG_SZ, REG_MULTI_SZ.
    
          5) Supported hives:  HKEY_LOCAL_MACHINE (HKLM),
             HKEY_CURRENT_USER (HKCU).
    
          6) Delimiters are case sensitive.
    
          7) REG_DWORD values are extracted from the registry in decimal 
             format.
    
    Examples:
        SETX MACHINE COMPAQ 
        SETX MACHINE "COMPAQ COMPUTER" /M
        SETX MYPATH "%PATH%"
        SETX MYPATH ~PATH~
        SETX /S system /U user /P password  MACHINE COMPAQ 
        SETX /S system /U user /P password MYPATH ^%PATH^% 
        SETX TZONE /K HKEY_LOCAL_MACHINE\System\CurrentControlSet\
             Control\TimeZoneInformation\StandardName
        SETX BUILD /K "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows
             NT\CurrentVersion\CurrentBuildNumber" /M
        SETX /S system /U user /P password TZONE /K HKEY_LOCAL_MACHINE\
             System\CurrentControlSet\Control\TimeZoneInformation\
             StandardName
        SETX /S system /U user /P password  BUILD /K 
             "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\
             CurrentVersion\CurrentBuildNumber" /M
        SETX /F ipconfig.out /X 
        SETX IPADDR /F ipconfig.out /A 5,11 
        SETX OCTET1 /F ipconfig.out /A 5,3 /D "#$*." 
        SETX IPGATEWAY /F ipconfig.out /R 0,7 Gateway
        SETX /S system /U user /P password  /F c:\ipconfig.out /X
      My Computers


  7. Posts : 414
    Windows 10 Pro
    Thread Starter
       #7

    Ztruker said:
    SetX has three ways of working:
    SETX is a nice workaround. Unfortunately it's a bit limited: it cannot delete environment variables.

    Microsoft itself suggested PowerShell as a workaround

    Windows PowerShell Tip: Creating and Modifying Environment Variables
      My Computer


  8. Posts : 14,046
    Windows 11 Pro X64 22H2 22621.1848
       #8

    No, you use SET to delete them.

    setx abc=123 .... abc is set to 123
    set abc ---------- abc is null and disappears
      My Computers


  9. Posts : 414
    Windows 10 Pro
    Thread Starter
       #9

    Ztruker said:
    No, you use SET to delete them.

    setx abc=123 .... abc is set to 123
    set abc ---------- abc is null and disappears
    Um... No, cannot use 'SET' to delete environment variables in the context of this issue. 'SET' is completely irrelevant here.

    • Firstly, the topic here is, one more time, permanent changes to user environment variables. 'SET' does not and cannot make permanent changes. 'SET' can only make changes to the environment of the current process. All these changes are lost once the process terminates. So, 'SET' is not applicable in this topic at all.

      This is exactly why we have 'SETX'. The whole point of 'SETX's existence is that changes made by 'SETX' are permanent.

    • Secondly, I don't know where you got the idea that 'set abc' will make variable 'abc' disappear (?). If variable 'abc' does not exist, then 'set abc' is simply invalid. If variable 'abc' exists, then 'set abc' will simply display its value.

      The proper syntax for "deleting" a variable using 'SET' is 'set abc='. Note the '=' part. However, as I said above, 'SET' is completely irrelevant here.
    Last edited by AndreyT; 26 Nov 2015 at 13:51.
      My Computer


  10. Posts : 1
    Win10
       #10

    this annoys the hell out of me on new build PC's
    I've not come to the bottom of it yet , however what I do is
    :-
    Win X - y [ to get t the system display ]
    advanced system settings
    Environment Variables
    add the ones you want
    ...

    I've found that after a while [it must be something else I do ] then you can edit the user Enviorment variables
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 09:18.
Find Us




Windows 10 Forums