Technology in terms you understand. Sign up for the Confident Computing newsletter for weekly solutions to make your life easier. Click here and get The Ask Leo! Guide to Staying Safe on the Internet — FREE Edition as my thank you for subscribing!

Why does Windows have a registry?

Question:

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.

Become a Patron of Ask Leo! and go ad-free!

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.

Do this

Subscribe to Confident Computing! Less frustration and more confidence, solutions, answers, and tips in your inbox every week.

I'll see you there!

10 comments on “Why does Windows have a registry?”

  1. The registry (or parts of the registry) is something that needs to be backed up sep. in my book. If you are one to install large games/software in a sep. partition like I do (to make the windows partition backup smaller), the registry is what will tell windows the location of those partitioned apps/games.

    Any windows reinstall or formatting of the windows partition will delete all traces, in the registry, of those partitioned items. The files will still be there, but to windows the files are useless. Windows does not remember them as a package of any installation, just data (much like a word or .txt document that hold no extra meaning); the items will not start or will be forced to recreate there registry items/locations (this can include CD Keys as well and further settings).

    If those locations in the registry were to be backed up after there installation, one would only have to run the backup after a fresh install to add to the registry those locations once again. Windows will then recognize the settings and files as part of an installation and your set.

    If something happens to your registry and you HAVE System Restore enabled, there is a chance of retrieving the earlier registry from a previous restore point. This data can be found in the “System Volume Information” hidden, system folder in the root of your windows partition.

    It is recommended to run xcopy in Recovery Console to back up this folder before doing a reinstall. You will then be able to extract registry keys from those applications installed in separate partitions for recovery usage.

    Reply
  2. “exceptional complexity” is not a virtue. The concept of the “Windows Registry” is one of the largest mistakes ever made in the history of computing. One can only imagine that “they” had something else in mind: like trying to hide and control our ability to conform applications to our needs. Just how do we initiate applications when their control parameters have been ensconced in such an obscure and obtuse manner? It is a debacle. And I don’t know why I put up with it. Linux has it’s problems, I should consider buying a BSD McIntosh. How much crap can we all take before we rebel against “the system?” No relevant OS designer would promote the Registry form of application initiation. Lord, such a bad idea.

    Reply
  3. Windows has a registry because the people designing Windows years ago were inexperienced. Every experienced techie knows that simple = reliable and complex = not-reliable. Also, Windows is, in effect, a monopoly and thus Microsoft is under no pressure to fix their mistakes. Specifically:

    OS information is not sufficiently segregated from application data in the registry.

    At boot time, the registry is a single point of failure.

    The registry is not backed up reliably. System Restore backs it up but SR is miserably designed. For example, it will turn itself off and not tell you under some conditions. And it has 99 rules for when it runs which no one can fully grasp (complexity again) thus it can go days and days between backups. And, SR breaks and by default wastes a huge amount of disk space.

    There is no automatic failover to a backup copy of the registry.

    Updating the registry is much harder and more dangerous than it should be.

    Reply
  4. I used to be a Windows fanatic – against anything Apple. But after actually sitting down with Mac OSX Leopard for a few days, I realized something – it’doesn’t have a registry. It doesn’t have the root cause of most (if not all) problems in windows. I’m sold. I now admit that Mac is better.
    Installing a program in windows involves multiple files, registry entries, random files in random places not to mention the Install Shield entry. But with Mac, installing a program is “drag and drop the program file” and that’s it. To uninstall, just delete the program file. No need to worry about losing registry entries and cluttering up the system with stray files.

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

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

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

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

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

    Reply

Leave a reply:

Before commenting please:

  • Read the article.
  • Comment on the article.
  • No personal information.
  • No spam.

Comments violating those rules will be removed. Comments that don't add value will be removed, including off-topic or content-free comments, or comments that look even a little bit like spam. All comments containing links and certain keywords will be moderated before publication.

I want comments to be valuable for everyone, including those who come later and take the time to read.