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 have no clue, but lately I've been having this problem. After running my workstation suddenly something destroys PATH and lots of stuff stops working. Initially, my path had MANY directories listed (I use Windows 7 as a development box) and after some time, I only had 3-4 directories listed in my path left.

I can't even open the System Properties dialog where I can see environment variables (because it uses shell variables to start it and it doesn't work). In short, I reboot every time.

Any ideas what might cause that problem? I didn't run anything new/unusual lately. Only VmWare (but I've been using it in the past and didn't have that problem back then).

I just checked, even %WINDIR% is not defined. WTF?!

share|improve this question
I've recently had the same problem on my 64-bit Vista box. With no obvious cause, if I open a new command prompt, then the path variable is set to the part of the path defined in "User variables". The "System variables" part of the path is missing. Some, but not all system variables are undefined. The registry looks OK, and everything looks OK in the System Properties dialog (using "c:\windows\system32\systempropertiesadvanced.exe"). After reboot, the system functions normally. Problem reoccurs every few days. A full virus scan found nothing. –  Lee Jan 10 '12 at 14:35
I had the same problem. I found a few different things that triggered it (running certain programs, running installers, etc.) but no reason those would cause it (they work fine on other machines or in a VM.) Eventually I had other problems compounding the need to reinstall which fixed everything. –  Jim McKeeth Jan 17 '12 at 2:27
my path was too long. I removed duplicates, removed useless entries and problem is gone. –  Pavel Feb 13 '12 at 0:48
add comment

4 Answers

up vote 33 down vote accepted

From my blog

Bottom line, if your PATH environment variable is more than 2048 characters it (and WINDIR) stop being visible in many contexts.

I fixed it by manually running c:\windows\system32\systempropertiesadvanced.exe and deleting one entry from my PATH to put me under 2048 chars. New cmd windows work just fine.

share|improve this answer
That's how I fixed the problem. I manually checked path, made it shorter and problem was gone. –  Pavel Feb 13 '12 at 0:49
Worked for me. Thanks! –  Jonathan DeCarlo Aug 15 '12 at 2:41
Just happened to me a couple days ago and I couldn't figure out why anything with %windir% just went bonkers. Fixed, thank you! –  Jesse Slicer Jul 15 '13 at 15:25
I just fixed the problem by restarting the computer... That's really a stupid limit of Windows! –  Edwin Yip Oct 22 '13 at 12:38
add comment

This may be a virus, or perhaps somebody just accidentally deleted it.

Check for viruses using the many options available.

There maybe system restores/backups available, but I'm not sure if system restore environment variables.

You need to format the HDD if the virus check fails.

share|improve this answer
Unlikely, i'm a professional programmer and I don't run crap on my pc. There is no problem with it (other than that win7 is trash), it's only after some time environemnt get's busted and simple reboot fixes it. –  Pavel Nov 9 '11 at 19:06
What are the "many options possible?" Could you expand on that? –  Simon Sheehan Nov 9 '11 at 20:14
@Pavel Watch-out getting cocky about being a "professional programmer" and imune to viruses. Sure, being a responsible user who knows their way around the computer reduces the likelihood, but anyone can get a virus. –  Jim McKeeth Jan 17 '12 at 2:25
I do some low-level system stuff, that's my job to know what's going on with the box. That's what I meant. So, I know quite well what can make my pc go banana. In short it seems there is a bug or some strange behavior if you have too make path entries. I manually edited it, removed duplicates and problem is gone. –  Pavel Feb 13 '12 at 0:47
add comment

you should get a program to monitor the registry keys

user variables



machine variables

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

you might catch the moment they get destroyed and narrow it down.

also, time how long it takes..after bootup. if you can at least know when it'll happen it'll help in narrowing things down.

try safe mode too. incase it's process related, and check event viewer.

share|improve this answer
add comment

When very low level functionality is breaking, this is when you abandon ship and just reformat it.

If something that low level is breaking, God only knows what else has been affected.

share|improve this answer
Simple reboot fixes it. There is nothing low level: some retarded app (or a bad script) might export busted environment and that's why it becomes broken. Simple reboot fixes it. –  Pavel Nov 9 '11 at 19:08
@Pavel: That is not a "fix." You need to find that app or script and remove it. That's not always easy if you don't keep tabs on what you install, what sites you visit and monitor everything regularly. –  Jeff Mercado Nov 9 '11 at 20:25
My only guess for now is that the PATH variable has too many dirs listed. So, I manually removed some crap from there. I'll see in a few days if the problem goes away –  Pavel Nov 9 '11 at 23:16
@Pavel: The path is limited to 255. That's the only limit. But you listed variables where it takes admin privileges to hide. That's the big worry. –  surfasb Nov 10 '11 at 2:18
add comment

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.