Windows 8 Hacks

Page 396

Delete Registry Keys and Values Using .reg Files You can use a .reg file not only to create new keys or values or to modify existing ones, but also to delete keys and values. To delete a key with a .reg file, put a minus sign in front of the key name, inside the bracket, like this: [-HKEY_CURRENT_USER\Control Panel\Accessibility\Keyboard Response]

When you import the .reg file, that key will be deleted. Keep in mind that you won’t be able to delete a key this way unless all of its subkeys have been deleted, so you’ll have to delete them first. To delete a key’s value using a .reg file, put a minus sign after the equals sign in the .reg file: "BounceTime"=-

When you import this into the Registry, the value will be deleted but the key will still stay intact.

Protect the Registry by Changing the Default Action for .reg Files As mentioned earlier in this hack, when you double-click a .reg file, the file doesn’t open for editing; instead, it gets merged directly into the Registry via the Registry Editor. This can cause serious problems, since most of us are used to double-clicking to open files in Windows. But the file will end up merging into the Registry and making Registry changes you perhaps didn’t want to make. To solve the problem, change the default action so that a .reg file is opened for editing in Notepad rather than merged when you double-click it. Head to the Start menu, type Default Programs, and then select the Default Programs icon that appears on the left side of the screen and press Enter. Click “Associate a file type or protocol with a program,” and scroll down until you find the .reg entry. Highlight it and click “Change Program.…” Click “More Options,” select Notepad (Figure 11-9), and then click Close. (If Notepad is not shown as an available program, click the “More options” link and scroll down until you reach Notepad. Click it. When Windows is done, click “Close” in the “Set Associations” window.) From now on, any .reg files will be opened with Notepad rather than by the Registry itself when you double-click them.

382

WINDOWS 8 HACKS


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.