You can determine the last Windows Registry key accessed in regedit by issuing a
reg query
command from a
command prompt. E.g., suppose I ran regedit and viewed
HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
and then
exited from regedit.
From a command line interface (CLI), i.e., a command prompt, I can issue
the command reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit /v LastKey
, which will show me the last key
that was accessed while in regedit. If I reopen regedit, it will start with
that key selected, i.e., it will open from the key selected when I exited from
the program.
C:\>reg query HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit /v LastKey HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit LastKey REG_SZ Computer\HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run C:\>
Note: the command is querying a key in HKEY Current User (HKCU), so the
results apply to the account from which the command is run. If you run the
command from a different account on the system, you will get the LastKey
value for that account.