Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I accidentally deleted the Path environment variable by creating a new one with Path name. How can i restore my old Path environment variable?

share|improve this question

3 Answers 3

I followed the advice in the answer to a related question here and recovered my previous path setting as of this morning using regedit. Expanding a bit on that answer, here's how I did it. (Read the linked answer to get the full instructions, I don't provide all the details here.)

I selected my earliest backup from today (11:43 AM timestamp in 'Today' section)

Example of previous versions of RegBack

and examined the earliest ControlSet within the HKEY_LOCAL_MACHINE/System node of that copy of the registry file, ControlSet002:

enter image description here

and copied out the previous value of my path variable from the key Control\Session Manager\Environment\Path within that level.

enter image description here

Your mileage may vary, as I don't know exactly what triggers the backup of the registry.

share|improve this answer
Even easier, a note from the old question "Note that for System, depending on how long ago this was, you can just go back into HKLM(old control set version)\Control\Session Manager\Environment without loading an old hive" –  Jahmic Mar 12 '14 at 6:38

I lost my PATH with a program install earlier today, but with all the existing programs already running, it was easy to get it back. If you have a command window open, run:

echo %PATH%

If you don't, you can look at the environment variables of currently-running programs with Process Explorer (procexp).

share|improve this answer
HOLY CRAP. I dont know why this didn't occur to me but you just saved me a humungous headache. TY. –  dudewad Mar 20 at 20:18
The "Ahah!" moment for me back when I posted this was quite rewarding. –  Thomas G. Mayfield Mar 20 at 22:07

You could do a system restore.

To restore your PC using System Restore

Swipe in from the right edge of the screen, and then tap Search. (If you're using a mouse, point to the upper-right corner of the screen, move the mouse pointer down, and then click Search.) Enter Recovery in the search box, tap or click Settings, and then tap or click Recovery.

Tap or click Open System Restore, and follow the prompts.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.