Regsvr32: What It Is & How to Register DLLs

How to Register & Unregister a DLL File With Regsvr32.exe

Man standing in front of lockers holding a sheet of paper
Glowimages / Getty Images

Regsvr32 is a command-line tool in Windows that stands for Microsoft Register Server. It's used to register and unregister Object Linking and Embedding (OLE) controls like .DLL files and ActiveX Control .OCX files.

When regsvr32 registers a DLL file, information about its associated program files is added to the Windows Registry. It's those references that other programs can access the registry to understand where the program data is and how to interact with it.

You may need to register a DLL file if you're seeing a DLL error on your computer. I explain how to do that below.

How to Register and Unregister a DLL File

If the references in the Windows Registry that refer to the DLL file are somehow removed or corrupted, programs that need to use that DLL file may stop working. It's when this association with the registry is broken that a DLL file should be registered.

Registering a DLL file is typically accomplished by reinstalling the program that registered it in the first place. Sometimes, however, you may have to register the DLL file yourself manually, via the Command Prompt.

Tip: See How To Open Command Prompt if you're not sure how to find it.

This is the correct way to structure a regsvr32 command:

regsvr32 [/u] [/n] [/i[:cmdline]] <dllname>

For example, you'd enter this first command to register a DLL file named myfile.dll, or the second to unregister it:

regsvr32 myfile.dll
regsvr32 /u myfile.dll

Other parameters you can use with regsvr32 can be seen on Microsoft's TechNet Regsvr32 page.

Note: Not all DLLs can be registered by just entering the command above into a Command Prompt. You might need to first close down the service or program that's using the file.

How to Fix Common Regsvr32 Errors

Here's one error you might see when trying to register a DLL file:

The module <DLL file> was loaded but the call to DllRegisterServer failed with error code 0x80070005.

This is typically a permission issue. If running an elevated Command Prompt still doesn't let you register the DLL file, the file itself might be blocked. Check the Security section of the General tab in the file's Properties window.

Another possible issue could be that you don't have the correct permissions to use the file.

A similar error message is worded like the one below. This error typically means that the DLL is not being used as a COM DLL for any application on the computer, which means there is no need to register it.

The module <DLL file> was loaded but the entry-point DllRegisterServer was not found.

Here's another regsvr32 error message:

The module <DLL file> failed to load. Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.

That particular error might be due to a missing dependency, in which case you can use the Dependency Walker tool to see a list of all the dependencies that the DLL file requires - one may be missing that you need to have in order for the DLL to register correctly.

Also, make sure that the path to the DLL file is spelled right. The syntax of the command is very important; an error may be thrown if it's not entered correctly. Some DLL files may need to have their location surrounded in quotes like "C:\Users\Admin User\Programs\myfile.dll".

See the "Regsvr32 Error Messages" section of this Microsoft Support article for some other error messages and explanations for what's causing them.

Where is Regsvr32.exe Stored?

32-bit versions of Windows (XP and newer) add the Microsoft Register Server tool to the %systemroot%\System32\ folder when Windows is first installed.

64-bit versions of Windows store the regsvr32.exe file not only there but also in %systemroot%\SysWoW64\.