Sunday, April 13, 2008

How to fix corrupt Windoze registry permissions

For some unknown reason my Windoze machine got the registry all screwed up. Hey, it's Windoze, every Windoze user has this done to them eventually. The effect was that I could not reinstall Micro$oft Office coz it gave a fatal registry error during the de-install. All the Micro$oft knowledge base articles were as useless as each other. Shareware registry cleanup utilities didn't clean it up either. Eventually I found out how to do this. You need a tool called subInAcl. Download it from http://www.microsoft.com/downloads/details.aspx?FamilyID=e8ba3e56-d8fe-4a91-93cf-ed6985e3927b&displaylang=en Then create a DOS batch file, let's call it fix-office-perms.cmd, containing the following:
cd /d "%programfiles%\Windows Resource Kits\Tools"
subinacl /subkeyreg HKEY_LOCAL_MACHINE /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CURRENT_USER /grant=administrators=f /grant=system=f
subinacl /subkeyreg HKEY_CLASSES_ROOT /grant=administrators=f /grant=system=f
subinacl /subdirectories %SystemDrive% /grant=administrators=f /grant=system=f
subinacl /subdirectories %windir%\*.* /grant=administrators=f /grant=system=f
Start a DOS command window, cd to where you put this script, then run it. Watch it repair the permissions. It takes several minutes to run. Strewth, what a hassle! But at least there is a way out. The corrupt registry seemed to be triggered by an error that happened during an attempted install of Visio. Towards the end of the install it said:
Could not open key: UNKNOWN\MsoHelp.HtmlHelp\CLSID.
Verify that you have sufficient access to that key,
or contact your support personnel.