Microsoft Windows Registry Guide, Second Edition

Controlling Registry Editor

Registry Editor (Regedit) has a few features that most users like, but some prefer to disable. The following sections show you how to customize these features. First, you customize the default action for REG files: in other words, you can control what Regedit does when a file with the .reg extension is double-clicked. Second, you prevent Regedit from saving its settings when you close it. By doing so, Regedit opens the window to the same size and position every time.

Default Action for REG Files

When you double-click a file with the .reg extension and click Yes when it prompts you to merge the file's settings, Regedit imports the file's settings into the registry. If you edit REG files frequently, this behavior might concern you because you might accidentally import a REG file when you meant to edit it. Conversely, if you frequently import REG files, you might want to prevent Regedit from prompting you to merge the file's settings into the registry. Here are steps for accomplishing both tasks:

Storing Window Position and Size

Each time you close Regedit, the program stores its view settings (window position and size, column sizes, last open key, and more) in the registry. The next time you run Regedit, it restores the window with those settings. Many users want Regedit to clear these settings, but Regedit doesn't provide an option to do that.

HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit is the key in which Regedit stores these settings. Set the key's Access Control List (ACL) so that you can't write to it, and then Regedit can't store its last view settings there. You can either delete the values in this key so that Regedit uses defaults every time it starts, or customize them so that Regedit uses your custom settings every time it starts. In either case, set the key's ACL so that you can read–but not write–values:

  1. In Regedit, click the key Applets\Regedit.

  2. On the Edit menu, click Permissions.

  3. Click Advanced, clear the check box that allows inheritable permissions, click Copy, and then click OK.

  4. In the Group Or User Names list, select each account and group; then clear the Full Control check box.

More Info

See Chapter 8, “Configuring Windows Security,” for more information about configuring keys' ACLs. In particular, if you decide that you don't like this customization, and you don't already own the key, you'll have to take ownership of the key to gain full control of it again.

Категории