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.

When I fresh boot my computer everything is dandy. Then after a few hours applications like Visual Studio, Notepad++, Games, iTunes, Windows components (Cmd prompt, Explorer, etc.), etc. stop working with errors about missing files or not being installed correctly.

I found that if I browse out to Cmd.exe and run it directly (instead of from the menu link) then I can run it, and the WinDir environment variable and others are missing (which explains why I can't run Cmd.exe from the shortcut since it uses %WinDir%\System32 for the path) and the system path is set to (NULL).

When I go to Advanced System Settings (again manually exploring to SystemPropertiesAdvanced.exe) all the environment variables are still there. I checked my memory utilization and I have 1 of 6 Gig free, with my Commit Charge peak well bellow the limit (like 30%).

The clipboard also stops working too.

Not running anything to exotic, although I do have a lot of Chrome tabs open. Running Backblaze for backup, Microsoft Security Essentials, and various other utilities. Closing things one at a time hasn't seemed to fix it.

It has been getting progressively worse (happening sooner and sooner). Would like to know what is causing it without reinstalling.

Running Windows 7 Ultimate 64-Bit

share|improve this question
    
This happens every time you boot and work for a while? –  Synetech Jan 24 '11 at 20:33
    
@Synetech: Lately it has been happening every time, but not after the same interval. Haven't discovered the pattern yet, expect that it frustrates me until I reboot. –  Jim McKeeth Jan 24 '11 at 21:50
    
Could it be a handle leakage? Have you checked task manager and enabled the relevant columns in the process tab to see if any of the processes are gobbling up all your handles? –  Lasse V. Karlsen Jan 24 '11 at 22:43
    
I have the same issue where most of my environment variables go missing. It seems to only occur after my system wakes from sleep. I'm running Windows 7 Enterprise 32-bit on a domain. –  user65691 Feb 2 '11 at 6:03
    
I started seeing the same symptoms on 64 bit Vista in December. My PC can run for a few days before this happens and I need to reboot. Kaspersky anti-virus has found no problem. Also reported here: [superuser.com/questions/355594/… –  Lee Jan 11 '12 at 9:28
add comment

3 Answers

Been fighting with the same problem. Symptoms:

  • reboot: all OK
  • after a while: programs seem to lose %windir% environment variable and therefore things start to break

In my case, I had a somewhat big %PATH%, so I trimmed down a lot of entries from PATH and it got fixed. Not sure how a big PATH can clean WINDIR but it seemed to have fixed it.

The effect of the fix isn't immediate (you have to reboot or restart explorer), but I can verify it by using task manager to kill explorer.exe and open it again (thus avoiding a reboot). Task Manager inherits environment variables from winlogon whereas process explorer seems to inherit them from whatever process started it, so it may keep your big environments problem even though you changed them.

share|improve this answer
    
This did the trick for me. I recently installed a program that but a whole bunch of stuff on my path, once I removed those entries, everything started working again. –  Eric Milas Dec 20 '12 at 18:07
add comment

Per Lasse V. Karlsen's suggestion I looked for a really high Handle count next time it happened. Audacity had 41K of them, and it has been rather unstable lately too. Unfortunately I have the latest version (1.3.12), and closing it doesn't seem to reclaim all of the handles. I'll file a bug report.

NOTE: While Audacity was leaking handles, this does not appear to have been the only cause of my headache. Still having troubles and haven't used Audacity since reboot. May be time for a reinstall.

I ended up reinstalling before finding a fix.

share|improve this answer
add comment

I also had a very long %PATH% environment variable. As a software engineer, I typically have several applications installed and removed from my computer on a regular basis. It is common for some applications to insert a semi-colon delimited entry into the %PATH% environment variable, typically if there is a potential that the installed application will execute from the command line (cmd.exe) because I am not too concerned with which applications will execute from the standard command line, I backed out all entries from the %PATH% variable except for C:\Windows\System32 (the place where most of your "cmdlets" are going to run from. A bit more information can be found on the topic on wiki-pedia @ http://en.wikipedia.org/wiki/PATH_(variable) For a quick fix (Windows 7) do the following:

1.) Click Start, in the search box at the bottom of the menu, copy and paste or type the following to open the System Advanced Properties Window C:\Windows\System32\SystemPropertiesAdvanced.exe (press enter)

2.) Click the Environment Variables button near the bottom of the window just slightly above the ok, cancel and apply cluster.

3.) The Environment variables window should be displayed now. In the second list box on the screen with the header text (System Variables) look for the word Path under the column Variable and Double Click it.

4.) You should be looking at what appears to be a list of directories on your computer that are separated by the ; delimiter. Take close attention, some you may want and some you may wonder why they are present, clear as many of the paths as your heart desires, the idea here is to shorten the path as much as you feel comfortable doing, again I shortened mine to C:\WINDOWS\system32 and have had no issues since.

5.) Once you have completed editing the Path variable, click "Ok" on all of the open dialog windows.

6.) Once again, click on start, in the bottom search bar, type taskmgr and press enter on your keyboard.

7.) Click on the "Processes" Tab and locate the process "Explorer.exe" under the "Image Name" column of the process grid. Click the process once to highlight it, then click the "End Process" button.

8.) Click File (if you do not see it, press the alt key first), click the sub menu item under file "New Task (Run)"

9.) In the input box displayed type explorer and press enter or click ok.

Test your broken links / shortcuts to see if they now work.

share|improve this answer
add comment

Your Answer

 
discard

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.