First of all, the system path environment variable is stored in the registry at:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\Path
You may have a backup of this value under
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment\Path
or ControlSet002 or ControlSet003, but most likely the value will be the same as under CurrentControlSet
.
The Path
value should be of type REG_EXPAND_SZ
and the default value looks like:
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;
if you have additional values, they are appended, or sometimes unfortunately prepended to the list. Semicolons separate each entry.
A lot of software including some by Microsoft itself, uses incorrect commands to add a new entry to this value and you end up with a value of type REG_SZ
and a value like:
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;
While this works in most cases, it breaks in others. Always better to use a REG_EXPAND_SZ
type.
After changing this value using regedit.exe
you should reboot your OS, especially if that value was incorrect before.