Stupid REGEDIT Tricks

This is probably one of those ‘been around forever and I just never noticed it’ features in REGEDIT.

Disclaimer: Use Registry Editor at your own risk. If you use Registry Editor incorrectly, you can cause serious problems that may require you to reinstall your operating system. This information is provided on an “as is” basis and all risk is with you. Improper use of Regedit can also make you sterile.  NoGeekLeftBehind makes no warranties, express, implied or statutory, as to any matter whatsoever, and does not guarantee that problems that you cause by using Registry Editor incorrectly can be resolved.

In REGEDIT the location of the current registry key is displayed at the bottom of the status bar, like this:

REGEDIT Key Location

Professional IT folks know the job isn’t over until the documentation is done. When documenting work performed in a service ticket I usually include detailed information about any registry settings that were changed. This means typing all of that location text at the bottom of the screen.

Well, it would seem I’ve been doing it the hard way all of these years.

SOLUTION

Just right-click the registry key name (in the navigation pane on the left), then left-click the Copy Key Name option.

Copy Key Name

Now the complete REGEDIT location is saved to your clipboard.

Example:
HKEY_CURRENT_USER\Software\Microsoft\Office\15.0\Excel\Security\Trusted Locations

Note: You’ll still have to document the DWORD or string values manually, but at least the Copy Key Name function saves a ton of typing.

Alternately, you can left-click the key name, then click on Edit | Copy Key Name from the top drop-down menu.

BONUS INFO

Now, you’re probably saying to yourself, “Duh, I already knew that! What I really need is a cool way to copy and paste a key path to avoid drilling down.”

Well, check out this nifty Windows Registry navigation trick by using the REGEDIT feature called Favorites (to which you probably never paid any attention).

To create a new REGEDIT favorite:

  1. Click the Key Name in the navigation bar on the left
  2. Click Favorites on the top drop-down menu
  3. Click Add to Favorites
    Sample registry location
  4. Type the name of the Favorite
  5. Click OK
    Add to Favorites

You should now see a new favorite listed, like this:

Jump to a Favorite

No matter where you are in the registry, clicking the Favorite will jump you to that location in the registry.

Interestingly, those Favorites / shortcuts are kept inside the registry itself,
(we’ll call it Rebel Base) here…

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites

…in a REG_SZ string value like this:

image
Here comes the ‘tricky’ part.

If you want to jump to a location in the registry you can just create a new String in Rebel Base.

For the sake of completeness we’ll show 4 options for registry favorites and changes

  • Option 1 – Manually Create a Registry Favorite

  • Option 2 – Manually Create a New String

  • Option 3 – Create a Registry Favorite by using REG ADD

  • Option 4 – Create a Registry Favorite by using PowerShell

OPTION 1 – Manually Create a Registry Favorite (easy)

If you know you’ll come back to a particular Registry location often:

  1. Navigate to the Registry location you want to save
  2. Left-click the Key*
  3. Click Favorites
  4. Click Add to Favorites
  5. Name the Favorite
  6. Click OK

*The first Favorite I would recommend creating is for Rebel Base, located here:
HKEY_CURRENT_USER
Software
Microsoft
Windows
CurrentVersion
Applets
Regedit
Favorites

If you perform Option 2 you’ll want to have that Favorite already saved.

OPTION 2 – Manually Create a New String

  1. a) Navigate to Rebel Base (if you already created it), or

    b) In REGEDIT navigate to HKCU | Software | Microsoft | Windows | CurrentVersion | Applets | Regedit | Favorites
     

    Registry Location A

  2. Right-click a blank space in the details pane | New | String Value
    New String Value
  3. Type the name of the new shortcut | hit Enter
    String Value Name
  4. Double-click the new string | paste the full registry path into the Value Data field | click OK

    Example – the location to enable / disable hiding file extensions:
    HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced

    Edit String

  5. You should now see your new Favorite in the drop-down menu.
    New Favorite

Once you create the Rebel Base shortcut, from that point on you can easily copy and paste a Registry path into a new Favorite and jump to it.

OPTION 3 – Create a Registry Favorite by using REG ADD

If you know the path and the registry value you want to change, you can use the REG ADD command from the command line.

Alternately, you can save the command into a text file and save it with the .REG file extension.

For more information on the REG ADD command, visit TechNet:
http://technet.microsoft.com/en-us/library/cc742162.aspx

To create a Registry Favorite by using REG ADD:

  1. Open an Administrative Command Prompt
  2. Type REG ADD (include a space after each step)
  3. <Key Name> Paste the location (Key Name) for Rebel Base
  4. <Value Name> Type /v followed by the name for the new Favorite
      example: /v ViaCommandPrompt
  5. <Type> Type /t followed by REG_SZ
      example /t REG_SZ
  6. <Data> Type /d followed by the path (Key Name) of the new favorite

    Example:
    REG ADD via command prompt

    If you performed the steps correctly you should refresh REGEDIT and see your new shortcut.
    New Registry Value added via Command Prompt

 

OPTION 4 – Create a Registry Favorite by using PowerShell

To add a new Favorite by using PowerShell, we use the New-ItemProperty cmdlet and specify the following parameters:

  • New-ItemProperty
  • -Path (the Key Name (location) for Rebel Base)
  • -Name (the name you want to give the favorite)
  • -PropertyType String
  • -Value (the Key Name (location) for the target shortcut)

Note: The following example uses the single back tick to make reading easier

Example:

New-ItemProperty

Note: You may notice that the -Path contains HKCU: instead of HKEY_Current_User. The HKCU: command is just a shortcut. 

However, DO NOT use the “HKCU:” shortcut in the -Value line.

Also, double-quotes are important if your -Value includes a space in the Key Name.

Here’s what the PowerShell looks like when it runs in ISE.

New-ItemProperty Successful

And if we refresh REGEDIT we’ll now see our new Favorite.

Registry Favorite via PowerShell

SUMMARY

Favorites are a quick way to jump around in the Windows Registry. There’s always more than one way to skin a cat, and today we looked at four ways to create a Registry Favorite.

I would recommend creating a PowerShell .PS1 file that sets up Rebel Base for you. Then you can add more shortcuts easily on the fly.

I hope this information helps!

VN:F [1.9.20_1166]
Rating: 10.0/10 (3 votes cast)
Stupid REGEDIT Tricks, 10.0 out of 10 based on 3 ratings

Leave a Reply