At the edge of tweaking

Menu

How to jump to the desired registry key with one click

If you are addicted to various registry tweaks like I am, you probably work with the Registry Editor very often. Various websites related to tweaking instruct you to go to different registry keys. I would like to share my own way to jump to the desired registry key directly and skip manual navigation with the Registry Editor. This can be done with a simple VB script file without using third-party software. Click "Read more" if you are interested.

As you can see, this is a per-user registry branch, so Windows stores the last used key for every user separately. It is possible to utilize this feature to directly jump to the key you need. Let me show how it can be done via Windows Scripting Host and VBScript.

The Implementation

Windows 10

If you are running Windows 10 build 14942 or above, you need no scripts of third party apps. Since build 14942, the Registry Editor app in Windows 10 got an address bar, which displays the current Registry key path, and allows you to copy and paste it.

You can use shorthand notation for HKEY_* root key names. They are as follows:

HKEY_CURRENT_USER = HKCU

HKEY_CLASSES_ROOT = HKCR

HKEY_LOCAL_MACHINE = HKLM

HKEY_USERS = HKU

So, when you need to go directly to HKEY_CURRENT_USER\Control Panel\Desktop, you can type the following in the address bar:

hkcu\control panel\desktop

Once you hit the Enter key, the path will be automatically expanded to HKEY_CURRENT_USER\Control Panel\Desktop. See the following screenshot:

Windows 8.1/Windows 7/Windows Vista and Windows XP

The idea is to copy the full path of the desired registry key to the clipboard and replace the LastKey value with the copied value from the clipboard. When regedit.exe is started after doing this, it will open directly at the key you want.

How to fetch clipboard content with VBscript

The "htmlfile" ActiveX object is used to display HTML help and HTA files in Windows. It can be used to fetch clipboard content. It does not even require IE to be installed . The code is as follows:

set objHTA=createobject("htmlfile") cClipBoard=objHTA.parentwindow.clipboarddata.getdata("text")

If clipboard content is text, it will be stored in cClipBoard variable. Simple, isn't it?

Directly opening Regedit at desired key

Since we now have the desired key in cClipboard, we have to write it into LastKey value metioned above. The code for that is:

RegistryOwnershipEx software

One of my apps, RegistryOwnershipEx, allows you to do the following tasks:

you can take ownership of a registry key with one click (useful to get full access to the key).

you can jump directly to the desired registry key also with one click.

It can also read any registry path from the Windows clipboard. If you run it with "/j" command line argument, e.g. regownershipex.exe /j, it will extract the registry key path from the clipboard and open Registry Editor directly. Personally, I prefer to use RegistryOwnershipEx. Get it here:

About Sergey Tkachenko

Sergey Tkachenko is a software developer from Russia who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Facebook, Twitter or Google+.

Post navigation

63 thoughts on “How to jump to the desired registry key with one click”

Mike

Don`t work in my Win 7 64-Bit. I have download the Script an select the Text. Then copy with ctrl+c to clipboard. Also the i startet the reg.nav.vbs and i become an error. the Message says that is an error in thze vbs-Sript.

The only slight problem is if the clipboard contains invalid data or no data then there is an error. Maybe it could just open Regedit to the top instead of giving an error. I guess this doesn’t really matter – it’s nice that this is super small and simple and it shouldn’t be made more complex…

Hi Thanks for this little script. OTOH you might be interested in this (even easier to use) Firefox extension: Open RegEdit Key, available at http://www.kashiif.com/firefox-extensions/open-regedit-key/. Select a registry key on a web page and select ‘Open in regedit’ from the context menu. Registry editor will open with that key being selected. Simple!

I’ve personally been using RegJump for a long time and prefer it to this method since it also checks the validity of your clipboard content and doesn’t change any registry keys. Just create a new textfile in the same directory as regjump.exe with the content @regjump -c and save it as something.bat. When you then run that it will automatically jump straight to the registry key you had in your clipboard.

Ok. I am on 10240 pro x64. All methods mentioned in this article work for me. I am using my app (ROEX) daily, and just now i checked the VBS script once again. Both works. Now give me your steps to reproduce: what you did step by step and what failed for you. Let’s resolve the issue.

It‘s true that this program doesn‘t work properly in Windows 10. It‘s working sometimes but for past several days I had to manually go to desired keys as it was displaying a screen I posted below. Perhaps I‘ll try using script instead of the program but it may not go well either.

It looks like that copying the key to the clipboard before opening your program works most of the time. If I get any bug in the future with specific key I‘ll post it here.

Sergey Tkachenko Post author

hmm OK. But can you tell me what exactly failed for you then?

MDJ

Can‘t find atm, perhaps it started to work.

MDJ

Faced this problem again. The key this time is: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows]

Sergey Tkachenko Post author

Try to remove brackets “[” and “]” from the key path.

MDJ

It did work. Perhaps me and others faced that problem only because of those brackets.

Sergey Tkachenko Post author

I will implement auto-replacement of those brackets in the next release.

MDJ

Great idea!

Sergey Tkachenko Post author

Actually, it was suggested by a user :)

MDJ

Sometimes in Windows 10 your program stops to work (doesn‘t jump to the key entered and shows “Current owner” as blank. I don‘t know what causes this problem but it may be that Explorer shell restarting. I‘m adding a screenshot also: http://i.imgur.com/3QAQjcn.png

I improved the VBScript. Now it works with registry-paths beginning with HKLM or HKCU for example. Additionally it removes spaces and it removes the backslash at the end of the string in the clipboard, if available. I know, this could be implemented easier, but my VB skills aren’t good.

Sergey, I believe the people for who it doesn’t work are doing the test by copying “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon” from your web page. In W10 at least in my tests with Edge if you copy any text with a space from this page an invalid character is copied for the space. Works fine where there are no spaces in the copied text. Pete

Sergey, is there any way to stop the comment system from replacing characters? Who needs curvy quotes? It took me a while to figure out that one of the errors with the copy/pasted code from Byron’s script was the minus sign being wrong! It makes no sense why forum software everywhere replaces the dash (minus) sign that is universally typed on keyboards all over the world with a slightly longer dash sign… Frustrating!

I tried to improve the VBscripts by Guest and Byron. It is now easier to copy a registry key and have it work correctly with the script.

The additions to the VBscript include:

1. Tabs are replaced with nothing. I’ve never seen a tab character in a registry key. Now any combination of spaces, tabs, or returns at the beginning or end of the registry key will be trimmed to work correctly.

2. Left and right brackets are removed from the beginning and end of the key. This helps because most registry keys are shown with brackets and now the brackets can be part of the copy without problems.

3. Some comments were added because I’m a VBscript novice.

NOTE: The comment system on winaero.com replaces various characters. This makes it so the VBscript code will not work correctly with only a copy and paste. Some characters need to be changed back to the original code.

‘ Replace all tab characters with nothing (I’ve never seen a tab character in a registry key) clipboard = Replace(clipboard, Chr(9), “”)

‘ Remove spaces at the beginning and end clipboard = Trim(clipboard)

‘ Trim left bracket “[” from the left and right bracket “]” from the right If Left(clipBoard, 1) = “[” Then clipBoard = Right(clipBoard, Len(clipBoard) – 1) If Right(clipBoard, 1) = “]” Then clipBoard = Left(clipBoard, Len(clipBoard) – 1)

Many thanks for your scripts and programs; they’re really handy and helpful. Just a bit of constructive criticism on this page, the Implementation section where you explain how to use shorthand notations for registry keys has a typo in the example provided: “hcku\control panel\desktop” should be “hkcu\control panel\desktop”. Very small mistake, but novice users will have a hard time understanding why it doesn’t work.

Again, thanks for your time and for your willingness to share your knowledge.