BrianPeek.com
A Compendium of Random Uselessness
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.

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.

Update 1/26/09: I’ve received a lot of emails from people stating that the “new” secedit fix isn’t working for them.  It’s certainly still worth a try to see if it will fix the problem as it’s an easier solution, but it you’ll likely still have to go with the subinacl method in order to correct the problem.

Updated solution (1/12/2009): Jim Beveridge left a comment below with a new solution that is a much better fix:

The solution is to reset the registry permissions by running this command (this is for Vista - should all be on one line):

secedit /configure /cfg C:\Windows\inf\defltbase.inf /db defltbase.sdb /areas REGKEYS

This is described in:

http://support.microsoft.com/kb/313222

Note that I intenionally added the /areas REGKEYS parameter to the command line so that only the registry would be updated. You don't want to reset file system permissions if you don't have to because some applications use non-default security settings.

This command should work on both 32-bit and 64-bit platforms. Secedit is more intelligent than the brute-force subinacl commands above. I also found that Secedit ran an order of magnitude faster than trying to run subinacl six or more times.

So, the below remains for posterity, but definitely try the above fix and see if it corrects the problem before trying what’s below…


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.


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

Comments

DotNetKicks.com wrote Weird Vista Registry Issue
on Tue, Dec 18 2007 6:34 PM

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

Steven wrote re: Weird Vista Registry Issue
on Sat, Dec 29 2007 8:53 PM

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.

Tangent wrote re: Weird Vista Registry Issue
on Thu, Jan 3 2008 9:09 AM

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.

photoshop dersleri wrote re: Weird Vista Registry Issue
on Sat, Feb 16 2008 10:41 AM

thank you

josh wrote re: Weird Vista Registry Issue
on Mon, Feb 18 2008 8:06 AM

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.

Benheck wrote re: Weird Vista Registry Issue
on Sat, Feb 23 2008 11:26 AM

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?

Sam wrote re: Weird Vista Registry Issue
on Thu, Feb 28 2008 7:46 AM

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?

john wrote re: Weird Vista Registry Issue
on Thu, Feb 28 2008 7:26 PM

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?

Brian Peek wrote re: Weird Vista Registry Issue
on Fri, Feb 29 2008 3:13 AM

@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

Bryan J wrote re: Weird Vista Registry Issue
on Fri, Mar 7 2008 7:43 AM

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

翻译公司 wrote re: Weird Vista Registry Issue
on Tue, Mar 11 2008 6:13 AM

Good article.Thanks a lot.

Patrick wrote re: Weird Vista Registry Issue
on Thu, Mar 13 2008 7:23 AM

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.

Tim wrote re: Weird Vista Registry Issue
on Thu, Mar 13 2008 7:58 AM

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

John Kisha wrote re: Weird Vista Registry Issue
on Thu, Apr 17 2008 5:21 PM

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.

Brian Peek wrote re: Weird Vista Registry Issue
on Fri, Apr 18 2008 2:27 PM

@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...

Inland Pacific Consulting wrote Windows VISTA Warning!
on Sat, Apr 26 2008 8:41 PM

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 ..

Inland Pacific Consulting Blog wrote Windows VISTA Warning!
on Thu, May 1 2008 1:42 AM

Windows VISTA Warning!

Josh wrote re: Weird Vista Registry Issue
on Sat, May 10 2008 4:15 PM

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?

Brian Peek wrote re: Weird Vista Registry Issue
on Sat, May 10 2008 4:49 PM

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.

John wrote re: Weird Vista Registry Issue
on Mon, May 12 2008 9:35 AM

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.

Josh wrote re: Weird Vista Registry Issue
on Sat, May 17 2008 2:05 PM

Brian,

In your experience, does this generally happen after initial install? Or does something seem to trigger the registry issue later on (i.e. MS patch, other software installation, etc.)

I just did a clean install of Vista with SP1 integrated into it and haven't seen this problem. My old install (without SP1 integrated) had the registry issue.

Brian Peek wrote re: Weird Vista Registry Issue
on Sat, May 17 2008 8:58 PM

@Josh, I've found it happens post-initial install.  I've never seen it show up until after I've had the machine running for a bit with other software installed, but I've found no trigger other than UAC being off.

Butch wrote re: Weird Vista Registry Issue
on Mon, May 26 2008 2:42 AM

I've had similar registry issues on my desktop vista machine.  Showed up when I installed the Zune 2.0 software.  I fixed it by taking ownership of the HK Classes Root, adding administrators, users, creator owner, system and my user profile to the permissions (full control) and propagating it down.  Dangerous sure.

Today I installed the XNA 3.0 CTP on my laptop (also Vista premium) which required me to install Zune.  Now I'm seeing registry error messages when trying to create a new project.  Probably the same permission thing.

Josh wrote re: Weird Vista Registry Issue
on Tue, May 27 2008 12:43 AM

For what it's worth, I've reinstalled my Vista using a slipstreamed version that has SP1 + all Windows updates through April of 2008 and I haven't had this issue appear since. I've installed all the same software I had on my previous installation where this problem surfaced...and as before, I have disabled the awful UAC. Still no issues.

I am wondering if this may have been something corrected with SP1 or recent update following? It seems that once you encounter this issue, there is no way to *permanently* fix the problem (unless I'm wrong?). Seems like you can only temporarily fix it until is gets screwed up again.

Josh wrote re: Weird Vista Registry Issue
on Tue, May 27 2008 12:46 AM

Also wanted to point out that my tactic since reinstalling Vista has been to create new System Restore points REGULARLY. I intend to catch my system when and/or if the registry gets screwed up and have a stable restore point to go back to. Hopefully, I can then figure out exactly what caused the corruption in the first place.

System Restore --- highly recommended!

Amway wrote re: Weird Vista Registry Issue
on Thu, May 29 2008 5:57 AM

i have had similar registry issues on my desktop vista machine.

doru wrote re: Weird Vista Registry Issue
on Tue, Jun 3 2008 3:14 PM

Have the same problem, I noticed it after I instaled XNA and vs2005 express edition. I had already instaled vs2008 professional, and with the last one I cant use c# anymore, c++ still working, I mean project with the respective language. Could be some recent vista update. XNA totaly broken.

Donovan Keith wrote re: Weird Vista Registry Issue
on Wed, Jun 11 2008 3:01 PM

I can't tell you how grateful I am for this fix. Every time I would load Microsoft Excel, Word, Outlook, etc I would get an install screen. When I installed Adobe CS3 and started getting similar errors I was frustrated to no end. The fix solved all those problems, my computer is running much more smoothly now. Thanks!

Daniel Tucker wrote re: Weird Vista Registry Issue
on Sun, Jun 15 2008 10:23 AM

Hi,

I'm afraid I might throw a spanner in your diagnosis here. I have recently started to have problems with programs continually doing "first run" setups and the Illustrator "registry state" issue. I have NEVER turnt UAC on OFF as by default its on. It started when I installed 'Microsoft Office Pro Plus 2007 with SP1 Installed' Ive lived with the issue & had no further problems until Adobe Illustrator. Im running your fix now but might I add that I run Vista x64 and had to alter the command line in the *.bat file to locate the folder correctly. I ended up with (CD "C:\Program Files x64\Windows Resource Kits\Tools") as my first line incase any other people are having similar problems. Ill let you know how I get on.

Brian Peek wrote re: Weird Vista Registry Issue
on Sun, Jun 15 2008 4:08 PM

@Daniel...

A few things:

1) By "registry state" you mean the above "no permissions set" state?

2) The cmd line for x64 users should start with "c:\Program Files (x86)"

3) I've found the fix to be of no help on 64-bit systems since istcacl is a 32-bit application and can only fix the 32-bit portions of the registry leaving a ton of it still in the broken state...are you seeing something different?

Thanks!

tuntis wrote re: Weird Vista Registry Issue
on Mon, Jun 16 2008 9:35 AM

Hey

Thanks for the fix. I had the same problem on my Vista x64 SP1 machine: your fix did 2 great things for me:

1) Visual Studio was in a "half broken" state. I couldn't make C++ or XNA projects (I could make C# projects though, because I managed to fix the permissions for them somehow). Now I can make whatever I want to!

2) Whenever I installed an Microsoft Office product (I tested 2007 and 2003), any program that used Windows Installer would pop up an Office Windows Installer dialog before starting. Now Office works like a dream!

I'm not sure how I can help, but I've had iTunes installed at some point and UAC is off for my account (which is an administrator).

Thanks again!

Rob wrote re: Weird Vista Registry Issue
on Mon, Jun 16 2008 10:54 AM

Hello,

I have a question similar to this registry issue. Yesterday (before I even knew about this page) I noticed in regedit.exe that HKEY_CLASSES_ROOT didn't have any permissions. I added the group Administrators with full control (since I'm the only one using the computer, and I'm in the group Administrators).

But after I did this, I noticed some Windows Media Player wouldn't start up and had to be reinstalled. Even worse, after installing I couldn't play any music or vids anymore. I also tried reinstalling all codecs but didn't work.

So.. me thinking the permission in the registry caused this all, I removed the permission again.

Things only got worse now, I couldn't start any program at all anymore (or well, all shortcuts that is). I decided to reboot my computer, since that sometimes helps with various issues.

And guess what, it even got worse! Vista did boot, but all I got was a black screen and my mouse pointer, no taskbar, no desktop, nothing else.

So I'm guessing I basically screwed up the registry, but I can't use my restore points, since I can't even get to the application for it. Also, since I'm using dual boot, I doubt there's still any restore points at this point, because once you boot the other operating system once, all restore points of Vista get deleted.

Is there still a way to get my registry back to the point where I didn't give any permissions yet? Or is the only option I have reinstalling Vista?

Thanks in advance if anyone could help me out.

Daniel Tucker wrote re: Weird Vista Registry Issue
on Mon, Jun 16 2008 11:18 AM

1) It was the message given by Adobe Illustrator "registry not in expected state". same issue as Benheck.

2) My fault, thast me thinking about 64bit Vista and typing it as opposed to x86 which I actually did.

3) Runnig it solved my Illustrator problem although the program did stop responding after quite some time & terminated itself. I have uninstalled Office so cannot comment on that program.

As I said though I have never switched off the UAC.

Gertjan wrote re: Weird Vista Registry Issue
on Sat, Jun 28 2008 4:20 AM

Thnx for your post, I pushed me in the right direction.

I just manually added the users 'Administrator' 'Myusername' and everything is fine now. thx again

Inland Pacific Consulting Blog wrote Windows VISTA Warning!
on Tue, Jul 8 2008 12:35 AM

Windows VISTA Warning!

jbrooks wrote re: Weird Vista Registry Issue
on Sun, Aug 3 2008 1:48 AM

I was having this while installing Visual Studio 2005 on VISTA

"The proper type library could not be found in the system registry."

and this when install SQL 2005 on VISTA

"setup could not connect to the database for server configuration"

Your posting solved both these problems.

nickr wrote re: Weird Vista Registry Issue
on Wed, Aug 6 2008 4:34 PM

I've had no problems with Vista until a few weeks ago when I installed Adobe CS3 Master Collection.

I started getting registry "expectation" messages for Illustrator and Indesign.  Then, my Flash Player was out of date, and removal and reinstallation resulted in registry error message, "information about installation can be found at www.adobe.com/go/tn_19166.

My user permissions looks like the "problem" scenario above.

Since nothing was wrong before using the Adobe "Cleaner" program, which took all old Adobe programs off the computer, I'm wondering if that clicked the permissions awry.

Thanks,

Nick

niki wrote re: Weird Vista Registry Issue
on Fri, Aug 8 2008 8:31 AM

I have the same problem with the registry - Vista SP1 with UAC turnet ON (it is always on - never off). So, I think UAC is not causing the issue.

Sorry for my bad english.