Windows – Lost Path environment variable, how to restore

pathwindows 7

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?

Best 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)
Related Question