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 you double-click a file with the .reg extension. 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, Regedit imports the file's settings into the registry after you click Yes when it prompts you to merge the file's settings. 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 how to accomplish both tasks:

  • Prevent Regedit from automatically importing REG files. To do this, you must make the default action for REG files something other than opening the file, such as editing the file. To do that, set the default value of HKCR\regfile\shell to edit. The next time you double-click a REG file, it'll open in Notepad.

  • Merge a REG file into the registry without prompting. To do this, change the command line that Windows XP executes when you open the file. Set the default value of HKCR\regfile\shell\open\command to regedit.exe /s "%1".

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 so on) in the registry. The next time you run Regedit, it restores the window using those settings. Many users like Regedit to forget 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. The trick is to set the key's ACL (Access Control List) so 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 Regedit uses defaults every time it starts, or customize them so Regedit uses your custom settings every time it starts. In either case, set the key's ACL so 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 Inherit From Parent The Permission Entries That Apply To Child Objects check box, 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.

    Note 

    See Chapter 7, "Managing Registry Security," for more information about configuring keys' ACLs. In particular, if you decide that you don't like this customization, you'll have to take ownership of the key to gain full control of it again, assuming that you don't already own the key.



Microsoft Windows XP Registry Guide
Microsoft Windows XP Registry Guide (Bpg-Other)
ISBN: 0735617880
EAN: 2147483647
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net