The Windows Registry should normally not be tinkered with. When professionals say that they mean it, because even they have probably screwed something up in the past. The Registry instantly saves any changes but unlike a Word document, for example, few people save the registry before making changes because it takes so damn long to do so!
That said, it is definitely worth learning about the registry and also the power of .reg files. So what are they?
.REG – The Format
These files are recognised by Windows operating systems to be registry files. Although they look like Notepad files, do not be deceived into clicking them. As soon as you do, the changes will be applied to the Registry.
The easiest way to understand .reg files is to make one yourself. Open up the Registry Editor and find a hive.
e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer.
Now, right-click “Internet Explorer” and click on “Export”. Save it wherever you like – it should be automatically with the “.reg” extension.
Now open up Notepad and then open this file you have saved with the .reg extension (or you can try just right-clicking it and clicking the “Edit” option if it appears). It should look something like this (I have only shown a portion for legibility):
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer]
“Build”=”86001″
“Version”=”8.0.6001.18702″
“W2kVersion”=”8.0.6001.18702″
@=”"
“IntegratedBrowser”=dword:00000001
“MkEnabled”=”Yes”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\AboutURLs]
“DesktopItemNavigationFailure”=”res://ieframe.dll/navcancl.htm”
“NavigationFailure”=”res://ieframe.dll/navcancl.htm”
“NavigationCanceled”=”res://ieframe.dll/navcancl.htm”
“OfflineInformation”=”res://ieframe.dll/offcancl.htm”
“Home”=dword:0000010e
“blank”=”res://mshtml.dll/blank.htm”
“PostNotCached”=”res://ieframe.dll/repost.htm”
“InPrivate”=”res://ieframe.dll/inprivate.htm”
“NoAdd-ons”=”res://ieframe.dll/noaddon.htm”
“NoAdd-onsInfo”=”res://ieframe.dll/noaddoninfo.htm”
“SecurityRisk”=”res://ieframe.dll/securityatrisk.htm”
“Tabs”=”res://ieframe.dll/tabswelcome.htm”
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ActiveX Compatibility]
“Version”=”6.17″
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\UnattendBackup\ShowStatusBar]
“StatusBarWeb”=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\UnattendBackup\SmallCommandBarIcons]
“SmallIcons”=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\URL Compatibility]
“Version”=”5.1″
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\URL Compatibility\~/CONNWIZ.HTM]
“Compatibility Flags”=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\URL Compatibility\~/CWIZINTR.HTM]
“Compatibility Flags”=dword:00000004
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Version Vector]
“VML”=”1.0″
“IE”=”8.0000″
You can see that the format is quite easy to read. Apart from the first identifying line, the rest of this file is simply referring to Registry hives and keys and their values.
Importing .Reg Files
.Reg files can be used to import registry settings. Although you can actually do this via the Registry Editor, it is far easier to just double-click the .reg file instead.
For example, if you went ahead and deleted the “Internet Explorer” part of your Registry right now then simply by double-clicking the .reg file then you would restore all your settings.
You can even keep multiple .reg files for the purposes of having different registry configurations although any application that forces you to do this is poorly programmed and should have allowed this to happen via the application itself.
Other Tricks
You can even use a .reg file to delete portions of the registry and do many other powerful functions. More on this in a later post. I hope you enjoyed so far learning about the Windows Registry.