If this article does not describe the error message that you are receiving, you can obtain detailed error message explanations, recommended actions, and additional support resources from the TechNet Events and Errors page.

Summary

Regsvr32 is a command-line utility to register and unregister OLE controls, such as DLLs and ActiveX controls in the Windows Registry. Regsvr32.exe is installed in the %systemroot%\System32 folder in Windows XP and later versions of Windows.

Note On a 64-bit version of Windows operating system, there are two versions of the Regsv32.exe file:

The 64-bit version is %systemroot%\System32\regsvr32.exe.

The 32-bit version is %systemroot%\SysWoW64\regsvr32.exe.

The syntax of the Regsvr32 command

RegSvr32.exe has the following command-line options:

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

/u - Unregister server

/i - Call DllInstall passing it an optional [cmdline]; when it is used with /u, it calls dll uninstall /n - do not call DllRegisterServer; this option must be used with /i

/s – Silent; display no message boxes

Common solutions for Regsvr32 errors

Try one of the following methods when you receive a Regsvr32 error:

Method 1: Re-run the Regsvr32 command from an elevated command prompt

To open an elevated command prompt, following these steps:

Windows 8.1 and Windows 8

Swipe in from the right edge of the screen, and then tap Search. Or, if you are using a mouse, point to the lower-right corner of the screen, and then click Search. Type Command Prompt in the Search box, right-click Command Prompt, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.

Windows 7 and Windows Vista

Click Start, type Command Prompt or cmd in the Search box, right-click Command Prompt, and then click Run as administrator. If you are prompted for an administrator password or for a confirmation, type the password, or click Allow.

Windows XP

Log on with an administrator account or an account that has administrator permissions, and then open a Command Prompt window.

Method 2: Use the 32-bit version of Regsvr32 to register a 32-bit DLL on a 64-bit version of Windows

If you receive an error when registering a 32-bit DLL on a 64-bit version of Windows, follow these steps:

Open an elevated command prompt.

If the 32-bit DLL is in the %systemroot%\System32 folder, move it to the %systemroot%\SysWoW64 folder.

Regsvr32 error messages

The following table contains RegSvr32 error messages and possible causes:

Error message

Cause

The command-flag ""%1"" is not valid. Please review the command usage and try again.

An invalid combination of options was passed in the command line to regsvr32.exe.

This command is only valid if a Microsoft Visual Studio OLE Activex Control project is opened.

Regsvr32.exe was invoked by Visual Studio but no modules were specified in the command line.

To register a module, you must provide a binary name.

Regsvr32.exe was invoked without specifying any modules in the command line.

The command OleInitialize failed to run. Your computer might be low on memory. Close any open programs and then try again.

Regsvr32 must initialize the COM library before it can call needed COM library functions and uninitialize the library when it shuts down. These error messages occur if an attempt to initialize or uninitialize the COM library is unsuccessful.

The module ""%1"" failed to load.\n\n Make sure the binary is stored at the specified path or debug it to check for problems with the binary or dependent .DLL files.\n\n%2.

There was an error in loading a module that was specified in the command line. The error text is displayed as part of the message.

The module ""%1"" was loaded but the entry-point %2 was not found.\n\nMake sure that ""%1"" is a valid DLL or OCX file and then try again

Regsvr32.exe was unable to find the required entry point in the module specified in the command line. This can occur if the entry points are not exported correctly from the module or if the module is not a .DLL or .OCX file.

The module ""%1"" was loaded but the call to %2 failed with error code %3.\n\nFor more information about this problem, search online using the error code as a search term.

There was an error when regsvr32.exe invoked the entry point in the module specified in the command line. The error code is displayed as part of the message.

The module ""%1"" may not compatible with the version of Windows that you're running. Check if the module is compatible with an x86 (32-bit) or x64 (64-bit) version of regsvr32.exe.

This error can occur, for example, if regsvr32.exe is run on an x86 computer and the module specified in the command line is a 64-bit module.

The following table contains RegSvr32 error messages and possible causes:

Error message

Cause

Unrecognized flag: /invalid_flag

You typed an invalid combination of flags or switches.

No DLL name specified.

You did not include a .dll file name.

Dll_Name was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.

The specified Dll name is not a .dll or .ocx file. For example, typing regsvr32 wjview.exe generates this error message.

Dll_Name is not an executable file and no registration helper is registered for this file type.

The specified Dll name is not an executable file (.exe, .dll, or .ocx). For example, typing regsvr32 autoexec.bat generates this error message.

Dll_Name is not self-registerable or a corrupted version is in memory.

For example, typing regsvr32 icwdial.dll returns this error message because the Icwdial.dll file is not self-registerable. If you suspect a corrupted version of Dllname is in memory, try restarting your computer or re-extract the original version of the file.

OleInitialize failed (or OleUninitialize failed)

Regsvr32 must initialize the COM library before it can call needed COM library functions and uninitialize the library when it shuts down. These error messages occur if an attempt to initialize or uninitialize the COM library is unsuccessful. For example, the Ole32.dll file may be corrupted or may be the wrong version.

LoadLibrary("Dll_Name") failed. GetlastError returns 0x00000485

From Winerror.h, 0x00000485 = 1157 (ERROR_DLL_NOT_FOUND). This means "One of the library files that are needed to run this application cannot be found." For example, typing regsvr32 missing.dll returns this error message if the Missing.dll file is not found.

LoadLibrary("Dll_Name") failed. GetLastError returns 0x00000002

From Winerror.h, 0x00000002 = 2 (ERROR_FILE_NOT_FOUND). This means "The system cannot find the file specified." In other words, a dependent DLL was not found. For example, typing regsvr32 icwdial.dll with Tapi32.dll (a dependency) missing returns this error message..

LoadLibrary("dskmaint.dll") failed. GetLastError returns 0x000001f

From Winerror.h, 0x000001f = 31 (ERROR_GEN_FAILURE). This means "A device attached to the system is not functioning." This behavior can occur if you try to register a Win16 .dll file. For example, typing regsvr32 dskmaint.dll returns this error message.