Explanation of Regsvr32 usage and error messages

SUMMARY

You can use the Regsvr32 tool (Regsvr32.exe) to register and unregister OLE controls such as DLL or ActiveX Controls (OCX) files that are self-registerable. This may be necessary to troubleshoot some issues with Windows, Microsoft Internet Explorer, or other programs.

MORE INFORMATION

Regsvr32.exe is included with Microsoft Internet Explorer 3.0 or later versions, Windows 95 OEM Service Release 2 (OSR2) or later versions, and Windows NT 4.0 Service Pack 5 (SP5) or later versions. Regsvr32.exe is installed in the System (Windows Me/Windows 98/Windows 95) or System32 (Windows NT/Windows XP/Windows Vista) folder.

Regsvr32.exe usage

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 used with /u calls dll uninstall
/n – do not call DllRegisterServer; this option must be used with /i
/s – Silent; display no message boxes (added with Windows XP and Windows Vista)

When you use Regsvr32.exe, it attempts to load the component and call its DLLSelfRegister function. If this attempt is successful, Regsvr32.exe displays a dialog box that indicates success. If the attempt is unsuccessful, Regsvr32.exe returns an error message. This may include a Win32 error code.

For example, to manually register a Sample.ocx ActiveX control, type the following command at command prompt:

c:\regsvr32.exe sample.ocx

Regsvr32.exe error messages in Windows Vista

The following list contains RegSvr32 error messages and possible causes.

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 Custom 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 appears 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 entrypoint in the module specified in the command line. This can occur if the entrypoints are not properly exported 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 entrypoint in the module specified in the command line. The error code appears 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 happen, for example, if regsvr32.exe is run on an x86 machine and the module specified in the command line is a 64-bit module.

Regsvr32.exe error messages prior to Windows Vista

The following list contains RegSvr32 error messages and possible causes.

Unrecognized flag: /invalid_flag

You typed an invalid combination of flags or switches (refer to the “Regsvr32.exe Usage” section in this article).

No DLL name specified.

You did not include a .dll file name (refer to the “Regsvr32.exe Usage” section in this article).

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

Dllname is not a .dll or .ocx file. For example, typing regsvr32 wjview.exe generates this error message.

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

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

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

Dllname may not be exported, or a corrupted version of Dllname may be in memory. Consider using Pview to detect the file and remove it.

Dllname 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. If you are running Windows NT, you may need to use the Kill or Pview tool from the Microsoft Windows NT Server 4.0 Resource Kit.

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(“Dllname“) failed. GetlastError returns 0x00000485

From Winerror.h, 0x00000485 = 1157 (ERROR_DLL_NOT_FOUND), which means “One of the library files 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(“Dllname“) failed. GetLastError returns 0x00000002

From Winerror.h, 0x00000002 = 2 (ERROR_FILE_NOT_FOUND), which 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), which 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.

DllRegisterServer (or DllUnregisterServer)in Dllname failed. Return code was: string

Search Winerror.h for string.

——————————————–

Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
Microsoft Corporation. All rights reserved. Terms of Use | Trademarks


You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

AddThis Social Bookmark Button

Leave a Reply

*
To prove that you're not a bot, enter this code
Anti-Spam Image