Monday, January 19, 2015

windows 7 - Lost Path environment variable, how to restore?


Within my 15 years of PC experience I have never seen something like this.


My Path variable within the Environment Variables is deleted for some reason. And now Windows 7 shows for Windows Explorer. Notepad, calculator and everything Windows related a "not found Icon" and it can't be started either.


I even tried to get System Restore started and it can't start saying missing parameter in Environment variables. I obviously can't get in System variables either to reset the path myself.


Is there a way to fix this or do I have to reinstall Windows for such minor thing?


Answer



You didn't lose the %PATH% variable; you lost the association for .exe files.


Go to a working Win7 computer, export HKCR\.exe and HKCR\exefile.
Then, either:



  • Press Windows+R, type command.com, type regedit, then import the files


If that doesn't work,



  • Go to the Windows Recovery Environment (from the installation CD) on the broken machine, run regedit, mount the key Windows\System32\Config\Software, and apply your exported keys to the mounted file.
    (You'll need to replace HKCR in the exported files with whatever path you mounted the key as; you may find it easier to recreate the keys yourself)


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...