Skip to main content

Timeline for answer to How to restore the Path environment variable I deleted? by Tom Mayfield

Current License: CC BY-SA 4.0

Post Revisions

10 events
when toggle format what by license comment
S Mar 18, 2025 at 13:22 history suggested myudak CC BY-SA 4.0
add command for powershell as its different command between cmd and powershell
Mar 18, 2025 at 1:26 review Suggested edits
S Mar 18, 2025 at 13:22
Sep 15, 2024 at 19:49 comment added Aerom Xundes I found this video to be very helpful in walking through each step for this approach. youtube.com/watch?v=abjMTXEiVwk
Feb 22, 2023 at 19:35 comment added Moisés Briseño Estrello Using echo %PATH% only displays the path that exists right now, it is the same as opening the windows prompt with the env variables. What we need is the erased path, and it won't be displayed using echo %PATH%. This answer is not helpful. Maybe it works if you just erased it but no if it was erased days ago.
Oct 30, 2022 at 18:12 comment added ruzenhack I do not have "History Files" activated, nor "system protection enabled", but I found a very simple solution, just look into a proccess details started before this change, as suggested by @dosaki at superuser.com/a/1127136/1743317. You will need to download the Proccess Explorer at learn.microsoft.com/en-us/sysinternals/downloads/…
May 13, 2020 at 7:55 comment added A-S Great solution, and I love Process Explorer, but as mentioned by others - long parameter are getting cut-out. I really recommend this answer: superuser.com/questions/523688/…
Sep 3, 2017 at 11:30 comment added Stein Åsmul Certain MSI packages can cause this problem - zapping the PATH environment variable. This is a useful trick if that happens to you - as is using System Restore if that is available. If you are on an SOE (Standard Operating Environment, or standardized desktops), you could try to copy the PATH variable from another computer - it is better than nothing and might work properly too if the application estate is the same on both computers.
Jun 20, 2017 at 19:54 comment added javydreamercsw This partially works as procexp does show the environment but long variables are not displayed completely. Also there's no way to export or something.
Oct 3, 2016 at 14:28 comment added triadiktyo Excellent answer. Saved me from restoring a backup. May I share a potentially not-so-obvious trick of how to open a command window if you don't have one open. If you have a program that has an open dialog (I used Chrome since it was open before I lost the path), hit Ctrl-O to open a website. Navigate to C:\Windows\system32\ and find cmd.exe. Right-click on cmd.exe and click Open. This will bring up a command prompt with the environment variables of the software (chrome in this instance) and you can echo %path% to get your old env variables!
Aug 16, 2014 at 18:58 history answered Tom Mayfield CC BY-SA 3.0