BrianPeek.com

A Compendium of Random Uselessness
in Search

Weird Vista Registry Issue

I'm attempting to track down a very strange Windows Vista registry permissions issue that hit me on two machines, that I've found mentioned in random various forum posts across the Internet, that has no known cause or solution, and which I cannot seem to reproduce in a VM though I've seen it happen on 2 machines across 4 Vista installs.  I'm hoping everyone that happens to read this post will take a few minutes to check the following and contact me directly or leave a comment with a way to communicate back to you.  Here's what to do:

  1. Run regedit.exe, everybody's favorite Registry Editor.
  2. At the root node of HKEY_CLASSES_ROOT, right-click and select Permissions from the context menu.
  3. Report what you see.  The first image is correct.  The second image is the problem scenario.

image reg

Subsequently, every subkey that is created or modified after this problem occurs has no permissions attached to them, causing all sorts of issues like COM components not being registered, file extensions not being registered, etc.  Permissions on every entry prior to the problem occurring are set properly.

I first noticed the problem when installing XNA 2.0 Beta, though its problems were caused by the already unnoticed and broken permission state.  Several folks in the XNA forums have reported a similar issue with no evidence of a cause, though I did find a not-so-perfect solution for x86 machines.  I have a feeling this is something that has happened recently, perhaps due to a Windows Update, but that's just a guess.

I attempted to reproduce this in a VM and failed.  I rebuilt my Vista x64 desktop since this was causing chaos and managed to reproduce it twice by installing Office 2007.  Yet, doing that same thing in a clean Vista VM would not reproduce it.  So that's not it either.  There are reports of it happening on both x86 and x64 installs.  There's obviously some sort of interaction here, but I have yet to find the common link.

Update:  My original installations were running with UAC off.  My first two re-install attempts ran with UAC off as I typically run.  On the third re-install attempt I left UAC on instead of turning it off and that seemed to make all the difference.  However....note that in attempting to reproduce this in a VM multiple times in multiple ways, UAC was turned off and the problem did not occur.

The partial solution below does not fix the root of the problem.  One can reset the registry permissions using subinacl from the Windows Resource Kit, but a) it's a 32-bit app so it can only touch the 32-bit reg keys, and b) HKEY_CLASSES_ROOT itself will still randomly reset its permissions to nothing though the subkeys will still retain their fixed permissions.  So, anything which attempts to write to the registry is once again broken.

To partially fix the issue, do the following:

  1. Install subinacl.
  2. Copy/paste the following to a batch file and run it, replacing YOURUSERNAME with your Windows username:
cd /d "%programfiles%\Windows Resource Kits\Tools" 

subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /grant=restricted=r /setowner=administrators
subinacl /keyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f /grant=restricted=r /grant=YOURUSERNAME=f /grant=restricted=r /setowner=administrators 

subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /setowner=administrators
subinacl /keyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f /grant=users=r /grant=everyone=r /setowner=administrators 

subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators
subinacl /keyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f /grant=users=r /setowner=administrators 

So, kind readers, please take a look at the above and let me know what permissions you're seeing on your registry so I can continue to find the root cause.

Published Nov 29 2007, 10:01 PM by Brian Peek
Filed under: ,

Comments

 

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

December 18, 2007 6:34 PM
 

Steven said:

I had the same problem. I tried using subinacl, but I don't know if I tried the command you posted here. Twice my laptop would not boot and I had to restore from a backup, so I spent a day setting the permissions on every messed up key manually. Now all my errors are gone (Hurray).

I did not set the permissions for HKEY_CLASSES_ROOT though. I am trying to do that now and wondering (looking at the other root keys, what RESTRICTED is. They all have it as read only, but I cannot add RESTRICTED.

For several of the programs that I use and have too much invested in, they use plugins which need computer access and would simply not work with UAC on. I tried all the run as administrator options without success.

I'm not sure if UAC off is the reason for the registry problem, but this is BS! Dear Microsoft, don't let me turn it off if you make sure the computer won't work right with it off.

Sigh. Thanks for this info. At least I am not alone.

December 29, 2007 8:53 PM
 

Tangent said:

This is a great utility and thank you for the instruction.  In my case, my Office 2007, after patched with SP1, never ceases to install itself every time I launch it.  A few of my programs also see the similar issue.  After attempting to fix it using RegEdit, which failed and crashed, my Vista had a lot of services fail to run (ironically it is way faster but a bit dysfunctional), thanks for this post.  I am able to install the util in an XP box and copy to my Vista, boom, things are back in business again.

January 3, 2008 9:09 AM
 

photoshop dersleri said:

thank you

February 16, 2008 10:41 AM
 

josh said:

How amazing to find your website detailing the exact same problem that I experienced on my system --- as well as the exact same conclusion pertaining to HKEY_CLASSES_ROOT not getting the correct permissions.

I partially solved this on my end by using a different software tool called Security Explorer, where I just gave "Everyone" permission to all of HKCR. This seems to have corrected many (but not all) of the issues. For example, even with permissions set in HKCR, my Office 2007 icons still do not display correctly. I don't know if this has to do with another part of the registry or other files in the OS that need to have permissions set properly but generally speaking, it's crystal clear that running with UAC off is causing MAJOR problems with permissions across the OS and that results in all kinds of issues like you mentioned.

February 18, 2008 8:06 AM
 

Benheck said:

I had this problem affecting 2 programs, AI CS3 and iTunes... iTunes specifically "reinstalling" every time it ran. AI would give a "registry not in expected state" message upon running.

I ran your solution and it fixed both. Permissions were set for HKEY_CLASSES_ROOT as well.

Last night iTunes took the liberty of updating itself to 7.6.1.9 and it removed the permissions from HKEY_CLASSES_ROOT. AI isn't affected, but once again iTunes had to "configure" upon running.

I shall run your fix again, but yes, iTunes seems to be what did it to me.

Does this help narrow it down?

February 23, 2008 11:26 AM
 

Sam said:

I also have the same problem and will be fixing it in a mo.

I don't have Itunes installed but I do have the Apple Software Update application installed (because of quicktime).  Might this be the culprit?

February 28, 2008 7:46 AM
 

john said:

maybe this is a stupid question, but do u have to use the fix he provided? cant i just go into the permissions box like he has up there and add them myself? why use 3rd party apps?

February 28, 2008 7:26 PM
 

Brian Peek said:

@John,

You'd know the answer to that if you tried it by hand.  :)  regedit.exe will not allow you to change the registry back in this manner likely due to the fact that the permissions are so out of whack.  It just throws an error if you attempt it.  Additionally, with the potential for so many keys and subkeys to be improperly permissioned, it's much easier to run the above batch file than to set security on hundreds of entries

February 29, 2008 3:13 AM
 

Bryan J said:

I was affected by this as well. It was causing random problems in many programs. I was getting install shield errors with any application utilizing InstallShield 11.5. I was getting errors with video editing apps, internet browsers...all sorts of random problems....so far this fix has eliminated my errors. I'm not sure how it got messed up in the first place, a few people mentioned ITunes....I also had that installed at one point, and I do use Apple Updater for Quicktime...that very well may be the culprit. If you need more info, e-mail me at nocturnex@neuroticnetworks.com

March 7, 2008 7:43 AM
 

翻译公司 said:

Good article.Thanks a lot.

March 11, 2008 6:13 AM
 

Patrick said:

I had exactly the issue. Regedit showed same as the second image. Office 2007 SP1 & iTunes were effected. They ran their install program every time I opened them. I was also unable to open or activate macdrive as it couldn't access its own registry entries!

The program and batch aboved sorted it out (booted to command prompt to be sure no active apps would interfere).

Office runs without complaining now, as does iTunes and I was able to activate macdrive.

March 13, 2008 7:23 AM
 

Tim said:

Hi peeps,

If I run the fix through subinacl it still gives me errors like 'Error when checking arguments HKey_CLASSES_ROOT' and 'Current object: HKEY_CLASSES_ROOT will not be processed' and also 'LookupAccountname: HKEY_CLASSES_ROOT users 1337 The securities-id structure is not valid'.

I ran also the fix of this webpage (forums.techarena.in/showthread.php). I had a problem installing Office Project, but now my Vista is messedup.

Maybe you guys understand more of this.

Greets Tim

March 13, 2008 7:58 AM
 

John Kisha said:

According to a tech I am now working with at MS, this seems to be caused by turning UAC on and off repeatedly. I guess it was designed to be either turned on or off, not to be toggled between on and off.

April 17, 2008 5:21 PM
 

Brian Peek said:

@John, I'm not so sure I believe that.  I have gotten the issue to show up accidentally once again on my laptop and UAC was turned off once and never turned back on...

April 18, 2008 2:27 PM
 

Inland Pacific Consulting said:

The last few weeks have found me in Vista hell with the fires being distinguished just yesterday...what a relief.   Vista has a new security 'feature' called User Account Control (UAC), which is designed to prevent novice computer users f ..

April 26, 2008 8:41 PM
 

Inland Pacific Consulting Blog said:

Windows VISTA Warning!

May 1, 2008 1:42 AM
 

Josh said:

Have we determined if this is caused by iTunes and/or Apple's Software Update? Or are there people that have this issue that never installed any Apple items at all?

May 10, 2008 4:15 PM
 

Brian Peek said:

It is definitely *not* caused by iTunes/Apple software.  I've never had either installed and still have experienced the problem.  The only link so far is UAC being turned off.

May 10, 2008 4:49 PM
 

John said:

I have the same problem.. it first appeared after installing MS Empressa Web 2.   Ran your suggested fix and all seems to be working for now.

May 12, 2008 9:35 AM

Leave a Comment

(required)  
(optional)
(required)  
Add

About Brian Peek

Brian is a Microsoft C# MVP who has been actively developing in .NET since its early betas in 2000, and who has been developing solutions using Microsoft technologies and platforms for even longer. Along with .NET, Brian is particularly skilled in the languages of C, C++ and assembly language for a variety of CPUs. He is also well-versed in a wide variety of technologies including web development, document imaging, GIS, graphics, game development, and hardware interfacing. Brian has a strong background in developing applications for the health-care industry, as well as developing solutions for portable devices, such as tablet PCs and PDAs. Additionally, Brian has co-authored the book "Debugging ASP.NET" published by New Riders, and is currently co-authoring a book titled "Coding4Fun" to be published by O'Reilly in late 2008. Brian also writes for MSDN's Coding4Fun website, contributing articles on a monthly basis.
Copyright (C) 2008 Brian Peek
Powered by Community Server (Commercial Edition), by Telligent Systems