4

In Explorer, when trying to edit the PATH environment variable on Windows 10 via Control Panel\All Control Panel Items\System » Advanced » Environment Variables, PATH is represented by a single row:

  •  %JAVA_HOME%\bin;%SPARK_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\PuTTY\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;%HADOOP_HOME%;
    
    Screenshot:Screenshot1

Usually, the GUI of the variable, represented by multiple rows, is shown:

How do I access the GUI multi-row table for the PATH environment variable as shown above?

JW0914
  • 7,052
  • 7
  • 27
  • 48
user3563894
  • 155
  • 1
  • 8
  • Have you tried Open Control Panel » System » Advanced » Environment Variables? – DavidPostill Jun 30 '20 at 12:16
  • Yes. This is exactly what happened (I clarify my question) – user3563894 Jun 30 '20 at 12:18
  • Interesting, I've never seen the multi-line one before. – gronostaj Jun 30 '20 at 12:35
  • @gronostaj The multi-line GUI window was added in Windows 10, though not sure in what bi-annual update _(I noticed in a year or so ago)_. – JW0914 Jun 30 '20 at 12:47
  • @user3563894 An FYI about the System `PATH`: the OS entries should be first, with any additions added to the bottom of `PATH` in the GUI or at the end of `PATH` if as a single line _(the User `PATH` can have entries anywhere)_. It's likely there's a Registry setting for showing the `PATH` GUI, however you may as well rule out system file corruption by executing the following in an Admin terminal, _in the order listed_: `Dism /Online /Cleanup-Image /StartComponentCleanup` → `Dism /Online /Cleanup-Image /RestoreHealth` → Reboot → `SFC /ScanNow` → Reboot → Test if issue still exists. – JW0914 Jun 30 '20 at 13:32
  • Possible duplicate [Is there a convenient way to edit PATH in Windows 7?](https://superuser.com/questions/297947/is-there-a-convenient-way-to-edit-path-in-windows-7/297950#297950) – Mokubai Jun 30 '20 at 13:35

1 Answers1

5

The first element of the list must not be the percent sign character (used as variable expansion character on MsDOS/Windows) for the graphical editor to show the variable as a multi-line list unless the variable to expand is %SYSTEMROOT%.

This is a "bug" in C:\Windows\System32\SystemPropertiesAdvanced.exe that's been present since the introduction of the multi-line editor in Windows 10 build 10586 (November 2015 update). It looks like this "bug" is an oversight by Microsoft since %SYSTEMROOT%\System32 and %SYSTEMROOT% (in that order) should always be present in your Path environment variable anyway.

You can simply prepend those two elements to the Path environment variable in order to solve this problem.
For example:

 %JAVA_HOME%\bin;%SPARK_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\PuTTY\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;%HADOOP_HOME%;

Becomes:

 %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%SYSTEMROOT%\System32\OpenSSH\;%JAVA_HOME%\bin;%SPARK_HOME%\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\PuTTY\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;%HADOOP_HOME%;
KvittoKonito
  • 66
  • 1
  • 3