星期三, 九月 19, 2007

Don't just delete registry keys!



 
 

Sent to you by Hudong via Google Reader:

 
 

via MSDN Blogs by Michael S. Kaplan on 9/19/07

The other day, someone from product support was working with a customer whose Add button on the Text Services and Input Languages dialog was grayed out.

You know, the Add button in this dialog:

It turns out this can only happen in some pretty catastrophic circumstances, like the registry key being missing.

I found myself intrigued about what the behavior might be like, so I decided to test things out here. So that you won't have to! :-)

First, let me point out the usual warning that the Microsoft Knowledge Base does:

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

Let me add one thing to that, if you wanted to do this yourself, back up the registry subkey, as the menu option below does:

PLEASE follow this advice -- if you don't then you are kind of semi-screwed without independently fixing the key back up....

Ok, now I will delete the "HKLM\SYSTEM\CurrentControlSet\Control\Keyboard Layouts" subkey.

So what happens when you try to launch the dialog?

Well, something very sad:

The Add... button is definitely disabled. It seems that since the dialog needs that data to populate the dialog, lack of any into pretty much makes it empty.

That IME is a Text Services Framework TIP, which is mostly stored elsewhere....

Of course that begs the question of what would have happened if I only had regular keyboards and no TSF IMEs, more like this situation:

If I deleted the key then, what would happen?

You don't want to know, trust me. :-)

Well, if you are going to twist my arm:

Yikes!

Incompatible keyboard driver detected. This dialog has been disabled.

In case someone as confused about the blank dialog. :-)

Of course you know what's next, right?

I have to try all of this on Vista.

Backing up the registry key first, of course!!!

Here is what the deleted keyboards registry key does:

The Add... button is not disabled!

Maybe it will work somehow?

Though the fact that it lists none of my keyboards makes me nervous, if you know what I mean....

Here goes:

Doesn't inspire much confidence, huh? :-)

Okay, enough excitement for one day, let's add those backup up registry keys back.

Hold our breath, launch the dialog again, and

Whew! Everything is back.

And the Add... button?

Good, everything is back.

Let's not delete sections of the registry any more. Some of those dialogs are plain disturbing!

This post brought to you by (U+1e35, a.k.a. LATIN SMALL LETTER K WITH LINE BELOW)


 
 

Things you can do from here:

 
 

没有评论:

发表评论