Windows7 corrupted profile - prevention exists?

0

I have dedicated Windows7 (not on domain) virtual machine for overnight automation testing. Some commands (mySQLdump, tscon.exe) must be run under administrator account.

Last week administrator account's profile was corrupted. I fixed it by renaming it in the registry and logging in as administrator. And today it is corrupted again.

I use administrator account only to run above commands via runas. Also the computer is restarted via cmd - shutdown command - quite often. Especially every night before automation testing starts.

I checked the comp for viruses - did full scan using avast although I believed that the comp is clean.

Any idea how to prevent the profile to get corrupted again?

update

So the first log entry in event log is today from 1.15am and one of my scripts ran runas command as administrator exactly at 1.15am. It was second time that runas war executed though after the testing started. The same happened second day in a row. Before the testing starts I need to copy one file that is locked. So I run handle.exe from runas to unlock it. That is what I think causing the profile to get corrupted. I am not able to reproduce it by myself.

The message from event viewer is

Windows cannot load the locally stored profile. Possible causes of this error include insufficient security rights or a corrupt local profile.

DETAIL – The process cannot access the file because it is being used by another process.

Radek

Posted 2012-10-17T01:14:10.247

Reputation: 2 914

2Find out what's causing the corruption. What takes place around the time of the corruption? Is it a registry corruption? File system? – None – 2012-10-17T03:53:26.233

I have no idea. I find out only when I need to run runas which might be hours after the corruption happend. I was told that 'corrupted profile on Windows7' is a common thing. – Radek – 2012-10-17T03:57:16.897

Answers

2

Corrupted profiles are kind of a common problem, but it's still a problem; One that's a symptom of a larger problem. It's "common", but not "normal".

On the other hand, based on the provided event log entry, your profile isn't corrupted, it just can't be loaded because during loading it's trying to access a file that's locked by another process (like it says). You have to determine what the file is, and why it's locked.

If you suspect it's your use of Handle.exe, maybe figure out another way to release the file you need to copy without abruptly closing handles, as that's highly unsafe. If you look at the usage info for Handle it even warns you "WARNING: Closing handles can cause application or system instability.". :)

Ƭᴇcʜιᴇ007

Posted 2012-10-17T01:14:10.247

Reputation: 103 763

hmmm, I suspect handle.exe but I cannot be sure. Also it doesn't happen always. Looks like it happens second time it is used. – Radek – 2012-10-19T00:40:51.347

The process that locked the file runs under the account I log in every time not the admin. How could it hold any file in administrators profile? – Radek – 2012-10-19T00:44:19.740

0

I had my user profile corrupted numerous times and had to rename or create new user profiles to use the computer. It turns out that this was happening when the computer would sleep or shut down while a McAfee virus scan was running. I have changed the power settings so that it never sleeps or shuts down and the problem has gone away.

Dan Merrick

Posted 2012-10-17T01:14:10.247

Reputation: 1