Restore overwritten PATH variable

4

I installed a program that cleared my %PATH% (probably this NSIS bug).
I don't want to run System Restore because of other changes I made that I suspect will be reverted (for example, my backup configuration).

Is there a way to recover the PATH from a system restore point or any other good way?

yakatz

Posted 2013-07-07T16:29:32.427

Reputation: 175

Pull it out of your mentioned backup? – Ƭᴇcʜιᴇ007 – 2013-07-07T16:30:21.703

@techie007 Unfortunately, one of the reasons I had to reconfigure the backup was because it was not backing up the registry. – yakatz – 2013-07-07T21:36:34.950

Answers

5

See key

HKEY_LOCAL_MACHINE\SYSTEM\ControlSet00х\Control\Session Manager\Environment
Path 

command line, LastKnownGood:

REG Query "HKLM\SYSTEM\Select" /v LastKnownGood

get all ControlSet00х hive list:

REG Query "HKLM\SYSTEM\Select"

get Path at ControlSet002:

REG Query "HKLM\SYSTEM\ControlSet002\Control\Session Manager\Environment" /v Path

STTR

Posted 2013-07-07T16:29:32.427

Reputation: 6 180

Perfect, it was in ControlSet002. I need to learn more about how Last Known Good Configuration works. – yakatz – 2013-07-07T21:41:28.383

0

One way to do it, which I did just now, is to download a program called Process Hacker and examine the environment of a program that was running before whatever overwrote your PATH. Of course, that only works if you're still running a program that was open before your PATH got overwritten, but I was, so I was able to salvage it.

Kef Schecter

Posted 2013-07-07T16:29:32.427

Reputation: 121