How to launch Windows' RegEdit with certain path?

Viewed 63321

How do I launch Windows' RegEdit with certain path located, like "HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0", so I don't have to do the clicking?

What's the command line argument to do this? Or is there a place to find the explanation of RegEdit's switches?

15 Answers

There's a program called RegJump, by Mark Russinovich, that does just what you want. It'll launch regedit and move it to the key you want from the command line.

RegJump uses (or at least used to) use the same regedit window on each invoke, so if you want multiple regedit sessions open, you'll still have to do things the old fashioned way for all but the one RegJump has adopted. A minor caveat, but one to keep note of, anyway.

From http://windowsxp.mvps.org/jumpreg.htm (I have not tried any of these):

When you start Regedit, it automatically opens the last key that was viewed. (Registry Editor in Windows XP saves the last viewed registry key in a separate location). If you wish to jump to a particular registry key directly without navigating the paths manually, you may use any of these methods / tools.

Option 1
Using a VBScript: Copy these lines to a Notepad document as save as registry.vbs

'Launches Registry Editor with the chosen branch open automatically
'Author  : Ramesh Srinivasan
'Website: http://windowsxp.mvps.org

Set WshShell = CreateObject("WScript.Shell")
Dim MyKey
MyKey = Inputbox("Type the Registry path")
MyKey = "My Computer\" & MyKey
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\Lastkey",MyKey,"REG_SZ"
WshShell.Run "regedit", 1,True
Set WshShell = Nothing

Double-click Registry.vbs and then type the full registry path which you want to open.

Example: HKEY_CLASSES_ROOT\.MP3

Limitation: The above method does not help if Regedit is already open.

Note: For Windows 7, you need to replace the line MyKey = "My Computer\" & MyKey with MyKey = "Computer\" & MyKey (remove the string My). For a German Windows XP the string "My Computer\" must be replaced by "Arbeitsplatz\".

Option 2
Regjump from Sysinternals.com

This little command-line applet takes a registry path and makes Regedit open to that path. It accepts root keys in standard (e.g. HKEY_LOCAL_MACHINE) and abbreviated form (e.g. HKLM).

Usage: regjump [path]

Example: C:\Regjump HKEY_CLASSES_ROOT\.mp3

Option 3
12Ghosts JumpReg from 12ghosts.com

Jump to registry keys from a tray icon! This is a surprisingly useful tool. You can manage and directly jump to frequently accessed registry keys. Unlimited list size, jump to keys and values, get current key with one click, jump to key in clipboard, jump to same in key in HKCU or HKLM. Manage and sort keys with comments in an easy-to-use tray icon menu. Create shortcuts for registry keys.

I'd also like to note that you can view and edit the registry from within PowerShell. Launch it, and use set-location to open the registry location of your choice. The short name of an HKEY is used like a drive letter in the file system (so to go to HKEY_LOCAL_MACHINE\Software, you'd say: set-location hklm:\Software).

More details about managing the registry in PowerShell can be found by typing get-help Registry at the PowerShell command prompt.

If the main goal is just to avoid "the clicking", then in Windows 10 you can just type or paste the destination path into RegEdit's address bar and hit enter.

RegEdit address bar

The Computer\ prefix here is added automatically. It will also work if you simply type or paste a path starting with e.g. HKEY_CURRENT_USER\....

PowerShell code:

# key you want to open
$regKey = "Computer\HKEY_LOCAL_MACHINE\Software\Microsoft\IntuneManagementExtension\Policies\"
# set starting location for regedit
Set-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" "LastKey" $regKey
# open regedit (-m allows multiple regedit windows)
regedit.exe -m

This is the best answer overall, as it's quick, simple and there's no need to install any program.
By Byron Persino, improved by Matt Miller. (Many thanks to both of them!)

I'm rewording more correctly and clearly to help other readers like me, as I had a lot of trouble getting it clear and make it working.

Make a .bat file, eg. 'GoToRegEditPath.bat' , write the following code inside and save it:

CODE:

@echo off
set /p regPath="Open regedit at path: " 
REG ADD HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit /v LastKey /t REG_SZ /d "%regPath%" /f
START regedit
exit
:: source: 
https://stackoverflow.com/questions/137182/how-to-launch-windows-regedit-with-certain-path?answertab=modifieddesc#tab-top

Maybe this .bat use must "Run as Administrator"
To use it, Just run it and paste (R-Click) in it the copied RegEdit Path.

Tip: if R-click does not work inside command prompt:
R-click on title bar > Properties > check both under "Edit Options"

Related