Windows 10: Buggy environment variable substitution - the order should NOT matter!

Discus and support Buggy environment variable substitution - the order should NOT matter! in Windows 10 Support to solve the problem; In preparation of an upcoming development project I downloaded and installed the latest Maven version. Then - as instructed - I defined me two... Discussion in 'Windows 10 Support' started by mmo, Feb 6, 2019.

  1. MMO
    mmo Win User

    Buggy environment variable substitution - the order should NOT matter!


    In preparation of an upcoming development project I downloaded and installed the latest Maven version.
    Then - as instructed - I defined me two environment variables:
    Code: M2=%M2_HOME%\bin M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-3.6.0[/quote] But for some strange reason the former %-placeholder 'M2' is not processed, i.e. "set" just yields:
    Code: M2=%M2_HOME%\bin M2_HOME=C:\Program Files\Apache Software Foundation\apache-maven-3.6.0[/quote] It seems that the order in which the env-var dialog stores these variables is important and if a former variable refers to one further down in the alphabetical list, then: bad luck!

    To test that hypothesis I defined me:
    Code: TestX=%TestY%\test3 TestY=%TestZ%\test2 TestZ=%JAVA_HOME%\test1[/quote] and the result is:
    Code: TestX=%TestY%\test3 TestY=%TestZ%\test2 TestZ=C:\Program Files\Java\jdk-11.0\test1[/quote] :-(

    This - dear MicroSoft guys - is BUGGY! Such substitutions should/needs to work regardless of the ordering of the environment variables names! Unbelievable, that nobody at MS ever noticed and fixed this!

    :)
     
  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. Searching environment variable in list

    I'm using a command that gives me a list of environment variables. When searching in the list, I want to find all environment variables with the word
    EXTERNAL; using the following command all that is occurring is all the environment variables are being listed instead of those environment variables with the word
    EXTERNAL ?

    findstr /c "EXTERNAL"
     
    StraightWorld, Feb 6, 2019
    #3
  4. Buggy environment variable substitution - the order should NOT matter!

    Edit - Set Environment Variables

    Recently I upgraded my Machine from Win 8 to Win 10, but I encountered many problems like virtual boxes related issues that does not create any problems prior to upgrading to Win 10.My mean concern as of now is I cant edit the system variable even I logged
    as the admin of my machine.I would like to add Java Jdk but windows does not allow me to add the path to environment variables.

    Is this a bug? Or what are the steps in order to edit environment variables in Windows 10 machine

    Ian
     
    ianrusseladem, Feb 6, 2019
    #4
Thema:

Buggy environment variable substitution - the order should NOT matter!

Loading...
  1. Buggy environment variable substitution - the order should NOT matter! - Similar Threads - Buggy environment variable

  2. Setting path variable in Environment variables Windows 10

    in Windows 10 Customization
    Setting path variable in Environment variables Windows 10: How can I stack up multiple path variables? Currently, it overwrites the old one when I try to edit. (I believe mindless updates are bad and updates should only happen when it is reasonably certain they will improve usability, and not just so that some people have a job.)...
  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. Automated modification of PATH environment variables

    in Windows 10 Performance & Maintenance
    Automated modification of PATH environment variables: The following archive contains scripts to safely edit the "Path" values in HKCU and HKLM. Useful to run after a new installation. path.7z New path inclusions are specified in "path.txt". Run "path.bat" to commit any changes. 103736
  7. 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...
  8. Environment Variables in Windows 10

    in Windows 10 Tutorials
    Environment Variables in Windows 10: How we use this? For example tried %OS% on CMD, PS and RUN but not work? 3234
  9. 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...
  10. Reset Java Environment Variable Path

    in Windows 10 Support
    Reset Java Environment Variable Path: I had to restore my PC to factory settings because of a virus (maybe overkill, not sure) and reinstalled the Java JDK and editing the Environment Variable for Path. First try gave me this: [img] Second try gave me this (I can't remember how): [img] I'm trying...