System Maintenance October 2006 • Vol.10 Issue 6 Page(s) 147-148 in print issue Register DLLs & Other Files Register The Appropriate DLL File To Repair Unstable Applications You may religiously back up your hard drive every Sunday and repair your neighbors’ computers for free, but despite those noble efforts you could still end up in what techies call DLL Hell. Although there’s no fire and brimstone in the DLL (Dynamic Link Library) version of hell, it’s still agonizing--a single out-of-date or improperly modified DLL can cause applications to close unexpectedly or become unstable. Worse yet, problematic DLL files can affect multiple applications because they’re often shared by many programs. For example, when an application opens a dialog box, it often runs the Comdlg32.DLL library file located in Windows’ System32 folder. By storing only one (shared) copy of a library file, Windows runs more efficiently; however, this means that a bad DLL file can cause errors in all applications that use the problem DLL. Although DLL corruption doesn’t happen often, you can unwittingly alter a library file--or change applications’ access to it--when you reinstall, uninstall, or update an application. Error messages such as “Cannot Start Program, is missing” or “Error Loading C:\\NameOfFile.extension” are indications the file in question has been deleted, copied over, or improperly modified. The best treatment for these symptoms is to replace and/or reregister the library file listed in the error message. Registering a DLL file makes it available to any Windows program that uses it and repairs errors by reconnecting the file to those applications. Know Your Library Code While the most common library files end with the DLL file extension, the file extensions OCX (OLE [Object Linking And Embedding] Control Extension), CPL (files that manage Control Panel functions such as mouse movement, user account settings, and the Add Or Remove Programs feature), DRV (device driver files), and EXE (executable files) may also denote shared resources that can be registered. As long as the file itself is not damaged, you can often correct a problem on your computer simply by registering it. Library Registration Before you can register a file, you should first search your computer to see if the file listed in an error message has been deleted. You’ll need to replace and register a deleted file or reregister an inaccessible file. If you don’t know exactly where the file resides, you can find it by using Windows’ Search function. In Windows XP, open the Start menu, click Search, and then select For Files Or Folders. Click All Files And Folders, enter the file name, and click Search. If the file exists, note its location; you’ll enter it when you register the file. A typical file path might be C:\WINDOWS\SYSTEM32\Shell32.dll. If the file has been deleted, you can either replace the file with a version located on your Windows installation disc or you can use a download site such as www.DLL-Downloads.com to retrieve an up-to-date copy of the missing file. Once you’ve located the file, it’s time to register it. To do so, click the Start button and select Run. In the Open field type regsvr32 \NameOfFile.extension and then click OK. For example, if you wanted to register the file called Shell32.dll, you’d type regsvr32 C:\WINDOWS\SYSTEM32\Shell32.DLL and then click OK. If the file registers successfully, you’ll see a message informing you that the registration was successful. (Note that not every library file is designed to be registered. For example, if you attempt to register Outlook Express’s Msoeres .DLL file, a dialog box will indicate that the file was found and loaded but that a DLLRegisterSever entry point cannot be found. You may need to uninstall and then reinstall a problem application to resolve library files that cannot be registered.) Note that EXE files are registered differently than other library files. Open the Start menu, select Run, and then enter “\NameOfFile .exe” /regserver. When using Regserver to register an EXE file, you need to include the quotation marks at the beginning and end of the file path. For instance, to register Internet Explorer’s EXE file, you would type “C:\Program Files\Internet Explorer\iexplore.exe” /regserver and then click OK. (Keep in mind that there is no space between the final forward-slash and the “r” in “regserver.”) When registering an EXE file you won’t see a message that the registration was successful. Some applications do nothing when registered, while others open upon success. If an EXE file cannot be registered, Windows will display an error message. Assess Your Situation Although you don’t see them in action, library files are being run almost every time you open an application or perform a common computer task. If you can recognize the function causing the problem, you may be able to determine which library file is at fault. For example, Shell32.dll contains routines that open applications and Web pages; if Shell32.dll is deleted or becomes corrupt, you won’t be able to open most applications or Web pages. Also, if a specific Windows task is not functional, you might be able to enter your problem into a search engine and find the appropriate DLL to register. You can also get more information about a library file through Windows Explorer by browsing the DLLs in your System 32 folder. To do so, right-click a DLL file, select Properties, and click the Version tab. You’ll see the name of the company that published the DLL plus information about the file’s version number and internal name; the description will often provide clues as to the primary purpose of the DLL. OCX files are, in effect, library files that each control a custom ActiveX function. They’re primarily part of interactive Internet content such as Web animations or multimedia video and music on a Web site. A single unresponsive Web page shouldn’t cause you to search your computer for missing or unregistered OCX files, but if you routinely have problems you can register an OCX file just as you would a DLL. For example, a missing ActiveX control such as Hhctrl.ocx will result in unresponsive, even though theoretically hyperlinked, table of contents in an application such as Microsoft Word. Although many factors could cause an inactive hyperlink, you should register Hhctrl.ocx if an application has a consistent problem opening a table of content’s hyperlinks. If you register a file and the errors continue, the file may be corrupt. For example, CPL files are sometimes targeted by viruses because Control Panel functions are responsible for key Windows tasks. If you can’t open Add Or Remove Programs, registering the file Appwiz.cpl may resolve your problem. Keep in mind, though, that a corrupt version of Appwiz.cpl (or some other library file) can be appropriately registered and still not function correctly. You can view the DLL (Dynamic Link Library) files shared on your computer by browsing HKEY_Local_Machine\Software \Microsoft\Windows\Current Version\Shared in the Registry. Be careful when using the Registry Editor, because one mistake could completely disable your system. Precautionary Measures Microsoft recommends that you always uninstall programs via Add Or Remove Programs in the Control Panel. That’s good advice, because Add Or Remove Programs identifies library files that are shared among multiple programs. In fact, during an uninstallation, you’ve probably had Windows ask if it should remove a shared resource; the resource to which it’s referring is very often a library file. DLL and OCX files are often removed in this fashion but normally it won’t hurt to keep the shared resource. We’ve mentioned that updating software can corrupt library files, but this can also be a way to fix a library file problem, and the benefits of updating far outweigh the possibility that a DLL will be damaged during the update. Just keep in mind that the best way to avoid DLL corruption is to always update your software from the original equipment manufacturer’s Web site. Even if you aren’t sure that a certain DLL is missing or corrupt, it doesn’t hurt to reregister a library file. If an application has become unstable, compare the DLLs on an application’s installation disc to the DLLs in an application’s designated hard drive folder. You’ll need to both copy and register any missing files. If no files are missing, it’d be wise to register an application’s DLLs before you perform a Windows Restore. (If you haven’t set a System Restore point in a while, you might remove newer applications from the Add Or Remove Programs list, which could cause problems later). Registering a file is not a cure-all, but it does present a quick, risk-free way to repair problems occurring in multiple Windows applications. As an added bonus, after you repair a friend’s or neighbor’s computer, you can impress him by saying you saved his computer from DLL Hell.