LastKey
value under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit
key stores the last opened key with regedit.exe
. When regedit is started, it shows the key that this value points to. LastKey
prior to invoking regedit, it's possible to specify which key regedit is going to show. regat.ps1
is the same idea but for PowerShell.