Helping people with computers... one answer at a time.

There are many potential ways to store program and system settings. Windows uses the registry. It's very complex, but its intentions were good.

Why does Windows have a registry? What's the benefit? What was so bad about older programs that could work all alone in their own directory?

I'm sure that any of us who've faced registry corruption have asked this question. As has anyone looking to twiddle by hand some obscure setting in a program.

In "the old days" settings were often kept in plain text files which in turn were kept with the program. Easy to find, easy to edit.

The Windows Registry changed all that.

If it helps any, the intentions were good.

The Windows Registry is a central database of organized program and system settings and information.

That all sounds very simple in concept, but in fact it's incredibly complex.

The registry exists to address a couple of basic issues and implement a couple of basic features:

  • Separation of "machine" settings from "user" settings. There are certain settings that apply to the machine - your network configuration perhaps. Other settings apply only to the user of that machine - say a color scheme or font size. In the past there was little need for distinction, but that has changed as we'll shortly see. The "HKEY_Local_Machine" and "HKEY_Current_User" branches of the registry are the most obvious place where this distinction is visible.

  • Support for different settings for different users. This is more complex than it appears. Windows is actually a multi-user operating system. Depending on your version that could mean multiple users at once, using Terminal Services on Windows Server, or only one of several different users at a time on all other versions. Somehow Windows needs to track that fact that you like your settings one way, while another person logging onto that same machine might like things another way. And yet the software that responds to those settings needs a quick and easy way to look for the settings it needs for the currently logged in user. The various sub branches of the "HKEY_Users" and the way that they "appear" as "HKEY_Current_User" depending on who's logged in are the primary drivers of this distinction.

  • "The good news is that most folks never really need to know or care about the registry."

    A centralized location for shared software. One of Windows' earliest goals was to make it easy to share software components. Rather than re-inventing the software to do something, multiple programs could use the functionality exposed in a single DLL. The registry provides a central and standardized place to locate the components that provide shared functionality.

  • Roaming support. This isn't something that most home users ever see. In fact many corporate installs never bother with this either, but the registry is an important component of roaming. When properly set, your settings - even your desktop - can be made available on any machine you happen to log into. (I've never actually seen it in use, and I understand it's difficult to set up.)

  • Registry level security. The registry supports the full Windows security model. That means that access to individual settings can be restricted.

Now, while you can argue whether or not the registry actually achieves these goals (in my opinion it actually does) or whether it needs to even have some of these goals (the jury's out), there's little arguing that it does all this in an exceptionally complex way.

On top of that, and in part because it's so complex, the registry has been abused to no end. The most common offenders are applications that don't uninstall their settings when they themselves are uninstalled. Once the application is gone it's often difficult to identify the registry keys that are "left over" and no longer actually in use. Doing so is one of the functions of a registry cleaner.

Personally, I'd prefer text based setting files, perhaps organized in a way to achieve most of the goals listed above. Linux certainly seems to do this fairly well. But regardless of why the registry is what it is, it's what we have under Windows.

The good news is that most folks never really need to know or care about the registry. Applications and the operating system as well as the occasional utility or toolkit typically handle putting a more reasonable user interface on managing most registry settings that users might want to change.

Unfortunately exceptions do happen, and they can be daunting.

Article C3123 - August 20, 2007

Leo Leo A. Notenboom has been playing with computers since he was required to take a programming class in 1976. An 18 year career as a programmer at Microsoft soon followed. After "retiring" in 2001, Leo started Ask Leo! in 2003 as a place for answers to common computer and technical questions. More about Leo.

Not what you needed?

Recent Comments
10 Comments

MichaelHorowitz: Linux has had the same deal since the begining. OS X, while good, is nothing new or special. It is just BSD with Apple's userland on top.

Posted by: senshikaze at August 28, 2009 8:33 AM

Window OS is not as good as people think it is because it still can not fix its own registry itself when someone (app) abuses it.

Posted by: ThuThien Ho at January 12, 2010 6:50 PM

The Registry is the CANCER in Windows. Every Windows version that has come out, I have hoped would do away with it. Still waiting.
Above all, it prevents program mobility. If the developer is dumb enough to go along with Microsoft and store information in the Registry, reinstalling Windows will stop that program from working because its Registry information will be gone.
While on this topic, placing .DLL modules in the Windows directory will have a similar effect. Only developers that keep all their settings and modules in their program's directory produce programs impervious to Windows reinstallation.
Such programs will also be as portable as DOS software used to be.

Posted by: Carlos Coquet at October 15, 2010 5:27 AM

Is there a way to replace the registry "database" with something more comprehensive and logically sensible?
There are many available databases that would surely suffice if tailored to suit, to rid windows of its worst "nightmare".

Only by rewriting major, major parts of Windows. And, sadly, ,for compatibility reasons many of the registry's worst behaviours would have to be replicated so as not to break applications. To be honest the storage media (database engine) isn't the problem, it's the overall organization of it, and that would take a major rewrite of Windows and most applications that rely on it.
Leo
11-Jan-2011

Posted by: zygmunt at January 5, 2011 7:04 AM

Microsoft has boxed itself into a corner by insisting on being compatible back to day one. After finding myself spending increasing amounts of time keeping Win2k and XP working correctly (and knowing Vista would just be worse), I threw in the towel and bought an Imac in 2007.

Now I spend my time fixing my friends computer systems. Don't get me wrong OS X is far from perfect but it's a hell of a lot better than Windows.

Posted by: bobc47 at January 18, 2011 9:11 AM
Post a comment on "Why does Windows have a registry?":





Remember Me?

(You may use HTML tags for style)

Before commenting, please...

  • READ THE ARTICLE. A comment that shows you didn't will be deleted and ignored.

  • Comment only on the article. Use the search box at the top of the page if you have a question about something else.

  • NO PERSONAL INFORMATION in the comment. No email addresses. No phone numbers. No physical addresses.

  • Anything that looks the least bit like spam will be deleted. Links to unrelated sites or links that appear to be primarily promotional will be deleted, or the comment will be deleted.

  • Don't ask me to recover lost passwords or hacked accounts. I can't. Those comments will be deleted.

  • I can't respond to every comment. And I can't vouch for the accuracy of others who do.

Please wait. Your comment is being processed ...