Need to recover older $PATH setting

2020-05-28 11:19发布

问题:

I have just installed an app which overwrote my $PATH variable... so now, a bunch of stuff will not work. While I have a full backup, I am hoping that there is an easier approach than to restore, get the PATH, the "roll it forward" again.

Is there a location in the windows registry (or anywhere else) that stores an older $PATH setting?

Thanks, GS

回答1:

If anyone is interested, I found the answer... using REGEDIT, it is under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment or HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Control\Session Manager\Environment

In my case, it was under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002...

GS



回答2:

type in cmd:

set path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;

above code will set the path temporarily. To set permanently, add %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\; to System Properties -> Advanced System Settings -> Environment Variables



标签: path recover