Sunday 26 August 2018

windows 7 - TEMP environment variable occasionally changes its value

I have Windows 7 Pro x64.


During the last one or two weeks, it happens sometimes to me that various applications cannot write to temporary directory. I've found that this is because the TEMP environment variable is set to the system value (C:\Windows\TEMP usually, I have it set differently), and not to the user value (B:\Users\%USERNAME%\Temp in my case). Also the explorer.exe process has TEMP set incorrectly, when this problem occurs.


Originally I thought that the incorrect TEMP value is set during winlogon, but it turns out this is not always the case. It's also important to say that this happens with several user profiles on the same computer, not only with my own profile.


Yesterday, when this happened again, I restarted the computer, logged in and checked that the explorer.exe process has this TEMP variable set correctly. Then I started several other applications, all have TEMP set correctly too. But today, after waking up the notebook from sleep, explorer.exe has incorrect TEMP value again, and hence every other newly started application inherits it! Its evidently still the same process as yesterday, as its a parent process for most applications, including those that were started yesterday and still have TEMP set correctly! I'm perplexed :-(.


Questions: How can anything like this happen? What can this strange behaviour be caused by? How to solve the problem?


The problem is frustrating as I always have to close everything and perform logout&login.


Remarks:



  • I use ProcessExplorer to see how the current environment of individual processes looks like.

  • I don't thing the memory gets corrupted. Because then TEMP would be filled with a nonsense, not with the valid system TEMP value.

  • There's plenty of space on the disks.

  • Nor I think that my profile is corrupted. Because the same I have notices with other profiles as well, and it doesn't happen always.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...