If you regularly tweak the registry in Windows 2000 or Windows XP, you're familiar with the Registry Editor's LastKey feature. This feature saves the path to the key that's open when you close the Registry Editor. The next time you launch the Registry Editor, it automatically displays that key. While this feature is designed to make it easier for you to subsequently make changes to a specific key without having to drill down through the registry tree each time, it can be annoying when you need to edit a different key. You're then forced to close all the open branches before you can drill down to the new key.
Wouldn't it be nice if, when you launched the Registry Editor, it would ask you whether you wanted to open the last edited key or start a new editing session? Unfortunately, such a feature isn't built into the Registry Editor. However, when you download and employ my RegEd Launcher HTML Application (HTA), you can make the Registry Editor do just that.
Behind the scenes
The funny thing about the Registry Editor's LastKey feature is that it is actually controlled by a setting in the registry itself. When you exit the Registry Editor, it creates a string value called LastKey in the Regedit key:
It then assigns it the path to the last key you were editing when you closed the Registry Editor. Then, the next time you start the Registry Editor, it looks for and retrieves the contents of the LastKey string value and opens that particular key. If the LastKey string value doesn’t exist, the Registry Editor will open at the root of the registry tree.
The job of the RegEd Launcher is a simple one. It will prompt you to either start the Registry Editor at the last edited key or to start at the root of the registry tree. If you select the former, the RegEd Launcher will simply launch the Registry Editor. If you select the latter, the RegEd Launcher uses the RegDelete Windows Script Host method to delete the LastKey string value before it launches the Registry Editor.
Permanently disabling the LastKey feature
The RegEd Launcher provides you with a way to be able to choose when you want to use the LastKey feature. If you never want to use the LastKey feature, there is a way to permanently disable it.
To do this in Windows XP, launch the Registry Editor as you normally would—by typing Regedit.exe in the Run dialog box. In Windows 2000, you must use the older Registry Editor by typing Regedt32.exe in the Run dialog box. Once the Registry Editor is up and running, navigate through the following subkeys:
Once you open the Regedit key, double-click on the LastKey value and delete the contents of the Value Data text box. Then click OK.
In Windows XP, right-click on the Regedit key and select Permissions. In Windows 2000, select the Regedit key, pull down the Security menu, and select Permissions.
When you see the Permissions for Regedit dialog box, select your account name and then select the Deny check box adjacent to the Full Control permission. Then click OK, click Yes in the Security confirmation dialog box, and then exit the Registry Editor.
Keep in mind that disabling the LastKey feature in this way, also disables the Favorites feature.
Installing RegEd Launcher
Once you download the RegEd Launcher installation package, simply double-click the RegEd Launcher Installation.exe file. When you do so, the installation program will prompt you to choose a folder in which to install the application. If the folder doesn’t exist, the installation program will create it for you.
After you install the RegEd Launcher, you’ll see the following four files in your folder:
Of course, the RegEdLauncher.hta file is the HTA file that you’ll use to launch the application. The RegEdLauncher.ico file contains the icon that the HTA uses for the control menu and the taskbar. The LastKey.gif and NewSession.gif files contain the graphic images, which are used to provide a visual representation of the operations performed by the RegEd Launcher.
Using the RegEd Launcher
Using the RegEd Launcher is quite easy. Once you have downloaded and unzipped the RegEdLauncher.zip file, double-click the RegEd Launcher Installation.exe file. You will be asked if you want to install the RegEd Launcher application; click Yes. Next, you will be asked to specify a location to install the four RegEd Launcher files: LastKey.gif, NewSession.gif, RegEdLauncher.hta, and RegEdLauncher.ico. Do so and click OK. To launch RegEd Launcher, simply double-click the RegEdLauncher.hta file. If you prefer, you can create a shortcut to the HTA file and place it on your Start menu.
Once you launch the RegEd Launcher utility, you’ll see the main screen, as shown in Figure A.
|The RegEd Launcher is designed to make it easy to switch between using the LastKey feature and launching a new editing session.|
All you have to do is select one of the option buttons, depending on how you want to launch the Registry Editor. Then click OK. When you do so, the script will edit the registry and then launch the Registry Editor. If at any time you want to abort the operation, just click the Cancel button.
Download RegEd Launcher
You can download RegEd Launcher by following this link or by clicking on the Downloads link in the navigation bar at the top of this page. TechProGuild and TechRepublic have many useful documents, templates, and applications available for download, so be sure to check out our other offerings. The RegEd Launcher Installation file is approximately 63 KB and has been zipped to increase download speed. You will need an unzip utility such as WinZip or PKZIP to expand the zipped file.
Greg Shultz is a freelance Technical Writer. Previously, he has worked as Documentation Specialist in the software industry, a Technical Support Specialist in educational industry, and a Technical Journalist in the computer publishing industry.