Open the Registry Editor at a given Key

Opening the Registry Editor at a defined Key.

Description: It`s known that opening the registry editor regedit.exe it will have the last registry key remembered and opens right where the it left off the last time it was running. The last registry key is being remembered in the registry itself using the LastKey value in HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit. To have regedit.exe open up at a specific location we just have to set the LastKey value properly before invoking regedit.exe. This can be done with the REG command.
Script:
1.
2.
3.
4.
rem open regedit.exe at HKEY_CURRENT_USER\Software\Microsoft
set "showkey=HKEY_CURRENT_USER\Software\Microsoft"
REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /v "LastKey" /d "%showkey%" /f
start /b regedit