Install and Register Own DLLs in Windows using Regsvr32

Last update: 14/07/2025
Author Isaac
  • Regsvr32 allows you to easily register and unregister DLLs and OCXs in Windows.
  • The system architecture (32 or 64 bits) determines where and how to register each DLL.
  • It is essential to use administrator privileges and the appropriate version of regsvr32 to avoid errors.
  • Correct registration of DLLs prevents application failures and facilitates system maintenance.

What is listdlls in Windows 8?

Installing and registering custom DLLs on Windows is a critical task for administrators, developers, and power users working with reusable or custom software components. If you need an application to run properly or are experiencing errors related to unregistered DLLs or OCX controls, knowing how to manage them manually can save you a lot of time and headaches. While it may seem complicated at first, the process is much simpler if you understand the tools and paths involved, as well as the nuances between OS 32 and 64 bits.

In this article you will find all the necessary information to install your own DLLs in the folder C:\Windows\System32 and register them using the Regsvr32 utility. Key concepts will be discussed in detail, commands Specific instructions for each case, the differences based on system architecture, and practical recommendations for avoiding common errors. Additionally, explanations of possible error messages and graphical alternatives are included for those who prefer not to work with the command line.

What is a DLL and why do I need to register it?

A DLL (Dynamic-Link Library) is a file that contains code and data that can be used by more than one program at a time in Windows. Thanks to these libraries, the size of executables is reduced and application maintenance and updating is facilitated. There are different types of DLLs, and although many work simply by being present in the system PATH, Certain DLLs require registration so that the operating system knows how to use them.This is often the case for OLE controls, ActiveX controls, and components designed to integrate deeply into Windows.

When we talk about registering a DLL, we are mainly referring to its CLASSES (CLSID) and other information being stored in the Windows registry. That way, any software that needs that component will know how to find and use it. If the DLL isn't registered properly, applications may display errors reporting that they can't find the required file or that the component isn't available.

  What to do if you accidentally delete system keys in regedit

Regsvr32: The tool to register and unregister DLLs and OCXs

Regsvr32

The primary command-line tool for registering and unregistering DLLs and OCX controls on Windows is regsvr32.exe. This utility is included with the operating system and allows you to easily run the registration process in which the function is called internally. DllRegisterServer() of the indicated file. Its use covers both DLLs and OCXs and is valid for most versions of Windows (from Windows XP to the most recent).

Location of regsvr32 and differences by architecture:

  • On 32-bit Windows systems, regsvr32.exe is in C:\Windows\System32. Here you will also need to copy the DLLs you want to register.
  • On 64-bit Windows systemsThere two versions of regsvr32.exe:
    • One 64 bits, also located in C:\Windows\System32.
    • Another of 32 bits, found in C:\Windows\SysWOW64.

    Interestingly, the “System32” folder contains the 64-bit files, while “SysWOW64” stores the 32-bit files.

Important: There is no executable named regsvr64.exe, so the two regsvr32 are used depending on the type of DLL to be registered.

Syntax and parameters of the Regsvr32 command

The regsvr32 command allows you to register or unregister DLLs/OCXs using various command line options. Here are the most relevant ones:

  • /u: Unregisters the server (removes its registration in Windows).
  • /n: Does not call DllRegisterServer; must be used together with /i.
  • /i: Call to DllInstall optionally passing a command string; if used with /u, the uninstall is executed.
  • /s: Silent mode, does not display any message boxes (either success or error).

General usage example:

regsvr32  <nombre_del_archivo.dll/ocx>

Example to register a DLL: regsvr32.exe C:\Windows\System32\Ejemplo.dll

Example to deregister: regsvr32.exe /u C:\Windows\System32\Ejemplo.dll

If you want to automate the process and avoid pop-ups, add the /s parameter: regsvr32.exe /s C:\Windows\System32\Ejemplo.dll

There is also the undocumented parameter /e, which suppresses information messages but displays error messages, which can be useful for quickly identifying errors in automated scripts.

Steps to install and register your own DLL in C:\Windows\System32

  1. Copy the DLL to the specified folder.
    • If the file is 64-bit and your system is 64-bit, copy it to C:\Windows\System32.
    • If the DLL is 32-bit and your system is 64-bit, the correct location is C:\Windows\SysWOW64.
    • On 32-bit systems, everything is managed in System32.
  2. Open a Symbol of the system with administrator privileges.
    • In Windows 10/8.1/8: Search for “cmd”, right-click and select “Run as administrator”.
    • En Windows 7 and Vista: idem, search for “cmd” in the start menu, right click, “Run as administrator”.
    • In Windows XP: Log on as administrator and open the terminal.
  3. Navigate to the correct directory using the cd command if necessary. For example:
    cd C:\Windows\System32
  4. Run the regsvr32 command pointing to your DLL. For example:
    regsvr32.exe Ejemplo.dll
  5. Wait for the confirmation message. If all goes well, you will see a box informing you that DllRegisterServer succeeded in the indicated file.

Registering 32-bit DLLs on 64-bit systems

Attempting to register a 32-bit DLL with the 32-bit version of regsvr64 will fail. To avoid this:

  1. Move the DLL to C: \ Windows \ SysWOW64.
  2. Open Command Prompt as administrator.
  3. Actually run the 32-bit version of regsvr32:
C:\Windows\SysWOW64\regsvr32.exe C:\Windows\SysWOW64\Ejemplo.dll

This will help you correctly register 32-bit DLLs on 64-bit systems.

How to know if a DLL needs to be registered

Not all DLLs require registration; Many can be used by applications simply by being located in a folder in the system PATH. However, DLLs designed to expose COM classes, ActiveX controls, or OLE objects do require registration. In general, if an application tells you that you need to register a DLL/OCX, or if you see errors related to missing files or CLSID issues, you should register it.

Also, if you change a version of a DLL or update it, it is recommended to unregister the previous one (/u), delete it, copy the new one and register the updated one.

Common errors and solutions when using regsvr32

Regsvr32

Errors when registering DLLs with regsvr32 are common, but they usually have a solution:

  • You do not have administrator privileges: Always open the command prompt as administrator.
  • 32-bit DLL registered with 32-bit regsvr64: Move the DLL to SysWOW64 and use regsvr32 from that folder.
  • Failed to find DLL: Make sure the path entered is correct and that the file is in the correct directory.
  • The DLL does not export DllRegisterServer: Only DLLs designed to be registered support this process; check that your file is compatible.

If the error message is ambiguous, you can consult the documentation for TechNet or investigate the exact code for more specific solutions.

Unregister and silent mode

To unregister a DLL or OCX, the process is the same, just add the parameter /u to command:

regsvr32.exe /u C:\Windows\System32\Ejemplo.dll

This process removes the registry information associated with the file in question, which is useful when uninstalling or updating the DLL.

If you want to avoid any pop-ups, especially in scripts or automated deployments, add /s for silent mode:

regsvr32.exe /u /s C:\Windows\System32\Ejemplo.dll

Note that in silent mode errors do not appear unless you use the parameter /e to show only errors.

  Learn how to use Microsoft PowerToys and get the most out of Windows.