79

I need to open a registry key such as the following in regedit.

HKLM\Software\Microsoft\Foo\Bar

Is there a tool which will navigate to the key for me, without my having to navigate the folders myself one by one?

Mateen Ulhaq
  • 3,452
  • 6
  • 35
  • 56
lance
  • 1,837
  • 3
  • 23
  • 36
  • 1
    To add my 2¢, a while back, I wrote a program to simulate keypresses for when regular pasting was not sufficient. I added a special mode for registry keys to let you copy a registry path and press the hotkey while in Regedit to have it automatically navigate to that path. Later, I wrote a program that would do some registry maintenance and needed to provide a jump-to-path function. I ended up having it detect if Regedit is open; if so it sends the right keystrokes (I copied the function from the old program), and if not, it wrote to `…Regedit\LastKey`, and opened Regedit; Regedit jumps itself. – Synetech Dec 29 '13 at 20:02
  • You can vote in Windows Feedback app( on Win10) "Regedit should have address bar functionality". The following link will work only in Win10 windows-feedback:?contextid=79&feedbackid=b11f8bdf-eaf4-4799-8e65-5161924ad22c&form=1&src=1 – Michael Freidgeim Apr 19 '16 at 13:20
  • 4
    Windows 10 now includes address bar functionality in the registry editor. [See my answer.](https://superuser.com/questions/115854/open-registry-directly-to-a-given-key/#1223675) – Miscreant Jun 28 '17 at 13:44

15 Answers15

86

This cannot be done using regedit.exe itself or any of its command line parameters.

However, Microsoft offers regjump.exe, a small utility (previously from SysInternals) that can be used to open the registry editor to a specified key.

Once you install this you can open to specified key like so:

regjump HKEY_LOCAL_MACHINE\Software\Microsoft\Windows

or even using abbreviations:

regjump HKCU\Software\Microsoft\Windows

Available abbreviations are:

HKCR - HKEY_CLASSES_ROOT
HKCU - HKEY_CURRENT_USER
HKLM - HKEY_LOCAL_MACHINE
HKU - HKEY_USERS
HKCC - HKEY_CURRENT_CONFIG
heavyd
  • 62,847
  • 18
  • 155
  • 177
mindless.panda
  • 7,262
  • 13
  • 47
  • 66
  • Works great with [Launchy](http://www.launchy.net/). :) – Mateen Ulhaq Nov 14 '11 at 05:03
  • 15
    Great. Now, if MS can provide the tool, why can't they simply modify regedit to allow for command line parameters? At least win7 does not yet have this... – BmyGuest Feb 19 '16 at 08:59
  • 2
    Note that Windows 10 requires regjump to be started with administrative privileges to work properly. – Vladimir Reshetnikov Nov 13 '16 at 21:04
  • 2
    Use `regjump -c` to open the key from the clipboard. – xmedeko Jun 14 '17 at 06:09
  • 4
    Windows 10 now includes address bar functionality in the registry editor. [See my answer.](https://superuser.com/questions/115854/open-registry-directly-to-a-given-key/#1223675) – Miscreant Jun 28 '17 at 13:45
  • @xmedeko create a shortcut to the `regjump.exe` Then edit the shortcut to add the `-c` argument. Add this shortcut to windows start menu (win10 requires the shortcut be preset with 'Run as Administrator' privilege, even if you are already an administrator [sigh]) Then when I am reading an article on where in the registry to edit, I copy the path and then run the shortcut. Jumps right to the copied section :) – Jon Grah Oct 19 '19 at 07:46
  • @VladimirReshetnikov also **Windows 7** requires regjump to be started with **admin privilige**. Just start **Windows Command with admin privilege** and then type `regjump some_path` – Marco Demaio Mar 05 '20 at 12:55
  • This can be done via Win CMD: `reg` – Zimba Apr 06 '20 at 14:25
  • @BmyGuest ... or a search history, or navigation controls, or a favorites list, or a way to retain the value selection after refreshing the view (F5). Finding the desired value is a pain when its under a key that contains 550+ values, and it's really annoying when you refresh the view to update the values and the selection is dropped. – Michael Ryan Jul 30 '20 at 23:21
26

Windows 10 now includes address bar functionality in the Registry Editor:

Registry Editor's address bar functionality

So just type or paste the path in the address bar, and press Enter.


The following abbreviations work with the address bar:

HKCR - HKEY_CLASSES_ROOT
HKCU - HKEY_CURRENT_USER
HKLM - HKEY_LOCAL_MACHINE
HKU - HKEY_USERS

So the HKCC - HKEY_CURRENT_CONFIG abbreviation doesn't work (at least as of this date).


You can activate the address bar by pressing Ctrl+L or Alt+D, just like in Windows Explorer.

Miscreant
  • 501
  • 6
  • 14
  • I have windows 10, and I do not have this address bar. And the two short cuts do not work. – WORMSS Aug 09 '17 at 12:50
  • @WORMSS That is weird. See if you have an `Address Bar` entry in the `View` menu of the Registry Editor. – Miscreant Aug 09 '17 at 19:19
  • I had checked, Nope, I must either (1) have an old version of RegEdit or (2) there is a second version of it on the machine somewhere but not on the %PATH%, I've checked my home PC running Win10 Home has the address bar already. Work PC running Win10Pro has classic RegEdit. Oh well, atleast now I know. – WORMSS Aug 10 '17 at 06:54
  • @WORMSS Maybe Microsoft added the address bar in the Creator's Update. – Miscreant Aug 11 '17 at 09:19
  • maybe, CU breaks some software at work, so we do not have it there... No idea if my Home PC has it.. Never bothered to look.. Thank you for you help. – WORMSS Aug 11 '17 at 12:23
  • This doesn't actually answer the question, though, which is looking for a way to do this from the commandline – EKW Jun 06 '21 at 07:01
20

You can do this by creating a simple VBScript on your desktop, without installing any additional software.

The script simply sets the "last used" key in the registry, before then opening it.

Open Notepad, stick this into it and save it as FooBar.vbs for example:

Set WshShell = CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey","HKLM\Software\Microsoft\Foo\Bar","REG_SZ"
WshShell.Run "regedit", 1,True
Set WshShell = Nothing

In the properties for the .vbs file you can tell it not to pop up a black box as it is running the script, to make it a little tidier.

If you wanted to be fancy, you could save the .vbs script somewhere else and create a shortcut on your desktop to it. You would then be able to change the icon and may it look pretty (if you really wanted to).

EDIT - If you wanted to be asked what key you wanted to open each time, here is what you would use instead:

Set WshShell = CreateObject("WScript.Shell")
Dim JumpToKey
JumpToKey=Inputbox("Which registry key would you like to open?")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey",JumpToKey,"REG_SZ"
WshShell.Run "regedit", 1,True
Set WshShell = Nothing
Kez
  • 16,631
  • 15
  • 67
  • 94
  • Changing the key to be opened to would require editing the script each time, unless it was supplied as a command line argument. Nice solution though, very useful. – mindless.panda Mar 03 '10 at 21:09
  • Well, I like this one as a solution because its extensible and teaches some basic scripting. I'm assuming you use a input box because running a script via command line requires invoking it via the script host? And so simply doing something like "script /key/foo/bar" isn't straight foward for a script on the command line? – mindless.panda Mar 03 '10 at 21:28
  • I deleted my comments. Try both and see which is easiest :-) – Kez Mar 03 '10 at 21:31
10

Copy the below text and save it as a batch file and run

@ECHO OFF & setlocal
SET /P "showkey=Please enter the path of the registry key: "
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /v "LastKey" /d "%showkey%" /f 
start "" regedit

Enter the path of the registry key you wish to open when the batch file prompts for it and press Enter and you would be able to open regedit with required registry key path.

rojo
  • 623
  • 3
  • 9
Anuresh Kothari
  • 101
  • 1
  • 2
  • I had to remove the `@ECHO OFF
    ` to make it work on windows 8
    – steampowered Oct 19 '15 at 13:32
  • Thanks, very useful. I've changed the `start "" regedit` to `cmd /c start "" regedit & exit` so that the cmd window closes automatically. – Ste Aug 15 '20 at 16:52
7

In RegEdit you have the ability to bookmark paths.

From the top menu choose

Favorites Add to Favorites

Zombo
  • 1
  • 24
  • 120
  • 163
Ak.
  • 156
  • 2
  • 2
    Once you've bookmarked your favorites, backup the registry key `HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Favorites` so you can easily restore on a new computer have have all your favorites again. – James L. Jul 16 '19 at 23:34
  • Fabulous. Often we use these tools and just know exactly where to go, also often missing built-in tooling that we don't notice because we aren't looking at the menu bar. Very well done, no code/batch/script required. – Brien Foss Jul 28 '21 at 22:58
3

Nircmd too can do it.

http://www.nirsoft.net/utils/nircmd.html

 Open the desired Registry key/value in RegEdit
 nircmd.exe regedit "HKLM\Software\Microsoft\Windows\CurrentVersion" "CommonFilesDir"

 Open the Registry key that you copied to the clipboard in RegEdit
 nircmd regedit "~$clipboard$"

RegScanner is a GUI to search the registry, with option to jump to selected key.

http://www.nirsoft.net/utils/regscanner.html

therube
  • 1,446
  • 7
  • 6
3

I use a powerful macro program (QWin) all of the time, primarily to type frequently used things. QMenu also has the ability to RUN applications.

When I told the author, Gary Chanson, about regjump and asked if it might be possible to pass the clipboard contents as a command argument, he updated it to allow passing the contents of the clipboard buffer as a variable which means;

When I now copy any key to the clipboard, all I have to do is hit the kotkey for QMenu and type "J" to go directly to that key in Regedit.

However, while the above works in XP, in Win7/8 QMenu fails because of the os' restrictions on running executables. While it would work by setting qMenu up as "RUN as admin" that required approving every keyboard macro that I called. Solution? Set QMenu up to RUN a shortcut for RegJump, and set the shortcut up to "RUN as admin. (you can pass an argument to a shortcut which will pass it on to the program it launches)

If QMenu sounds interesting, I have a page about using it at bevhoward.com/WinTools.htm

Note, while I have been using Gary's tools for many years, different AV programs have flagged some of the files as infected... in the case of the updated QMenu, it got flagged by Avast, but the issue is supposed to be resolved with their next update.

Hope that this information is of value. Beverly Howard

user285425
  • 31
  • 1
  • Welcome to Super User! That's a great reply, but would you mind adding some of the information you have on the page you linked to? It's all good and all, but it's best if it's here - that way, should you site go down or change, the answer to the question is still available. :) – Thor Dec 29 '13 at 20:11
2

I have a set of services representing different instances of a bit of homegrown software; the service names all start with the name of the software, followed by certain instance-specific details.

ProgramName_Detail1A_Detail1B
ProgramName_Detail2A_Detail2B

The descriptions are frequently updated as the intended usage of each instance will change over time, but description can only be changed in the registry. With that in mind, the following .BAT code finds the first "ProgramName*" service and opens regedit with that first service already selected. (My service names contain no spaces; if yours do, some adaptation will be required.)

@echo off
setlocal

set __first=
for /f "tokens=5 delims=\" %%i in ('reg query HKLM\system\currentcontrolset\services /f ProgramName*') do call :findfirst %%i

if "%__first%" == "" (
  echo No ProgramName entries found in registry. Aborting...
  pause
  goto :EOF
)

reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit /v LastKey /d Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\%__first% /f

start regedit

goto :EOF

:findfirst
if "%__first%" == "" set __first=%1

goto :EOF
1

If you have to use it a lot, it makes sense make it easier - you can combine RegJump and Notepad++ to go to your registry location after selecting reg path in text.

Download regjump, unzip into your safe location, create batch file :

C:\[...path to your regjump.exe...]\regjump.exe %1

Here is how to achieve this:

  1. Install NppExec via Plugins, Plugin Manager.
  2. Then in NPP - click F6 (NPP menu: Plugins/NPP Exec/Execute) add/save the following: (if you call regjump.exe directly, it will flash, but not open registry..., you can try to call it using cmd with switches)
C:\[...path to your batch file...]\regjump.bat "$(CURRENT_WORD)"
  1. Save script, put name "RegJump to"
  2. open Plugins/NPP Exec/Advanced Options...
  3. in lower left under 'Associated Script' drop down select your 'RegJump to'
  4. click 'Add/Modify' button
  5. check under top Menu items 'Place to the Macros submenu'
  6. click 'OK' to close 'NPPExec Advanced Options' window

usage: if you have text open in Notepad++ which contains registry path, select this registry path and click in Menu: 'Macro/RegJump to' - it should open registry in the needed location, if path is correct. if path is not correct, it will open registry in the closest parent path.

regjump supports abbreviated keys as well: HKLM\Software\Microsoft

Sasha Bond
  • 130
  • 4
1

There is no way of doing this with the standard Registry Editor on it's own.

However, Microsoft/Sysinternals have a tool called Regjump that does exactly what you need - launching to the correct place in registry editor.

William Hilsum
  • 116,650
  • 19
  • 182
  • 266
1

One thing you might consider doing if you use Regjump is to set up an environment variable, for example REGJUMP=C:\path\to\regjump.exe. Then you can use Regjump from the 'Start Search' box in, say, the Windows Vista Start Menu:

typing %REGJUMP% in Start Search box

[You may need to browse to the location of regjump.exe and set regjump.exe to have 'Run this program as an administrator' Privilege Level on the Properties->Compatibility tab. This will ensure that Regjump operates correctly on computers running with User Account Control].

Andrew Wyatt
  • 298
  • 2
  • 5
  • Or, add the whole Sysinternals Suite to the path. In my experience a great idea. – usr Feb 22 '17 at 11:53
1

With Autohotkey plus regjump, you can define a keyboard shortcut to jump to a key path on the clipboard. Example:

^!+k::
  Run path\regjump.exe %clipboard%
  return

Note that for Win7 you'll need to set "Run this as an administrator" in the Compatibilty properties of regjump.exe

Chris Noe
  • 397
  • 2
  • 5
  • 16
1

The easiest way is using 3rd-party software. The most effective one is Registry key jumper, and it is a portable freeware.

The most interesting part is that you don't have to copy a registry key: just select it and use CtrlAltX, then i and registry key location will be opened automatically. If you select e and type some text, if there's a registry key inside, Registry key jumper can automatically eliminate the text and will open the key location.

m4573r
  • 5,561
  • 1
  • 25
  • 37
Someone
  • 11
  • 1
1

This batch file works for me on windows 8 if regedit is closed when the batch file runs.

showkey=Please enter the path of the registry key:
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /v "LastKey" /d "%showkey%" /f 
start regedit
steampowered
  • 2,627
  • 13
  • 38
  • 45
0

On Win CMD:

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /v "LastKey" /d "YourKey" /f & regedit

If "YourKey" doesn't exist, regedit will open to "Computer" key

Tested on Win 10

Zimba
  • 1,051
  • 11
  • 15