You can use Regsvr32 tool (Regsvr32.exe) for self-registered object links and embedded (OLE) controls, such as dynamic link library (DLL) files or ActiveX Control (OCX) files) to register and cancel registration.
Regsvr32.exe usage
RegSvr32.exe has the following command line options: Regsvr32 [/u] [/n] [/I [: using line] dllname
/U-Unregister server <BR/>
/I-Call DllInstall passing it an optional [skip line];
When used with/u calldll uninstall
/N-do not call DllRegisterServer; this option must
Be used with/I
When you use Regsvr32.exe, it will try to load the component and call its DLLSelfRegister function. If this test succeeds, regsvr32.exe will display a dialog box Indicating success. If this test fails, regsvr32.exe returns an error message, which may contain a Win32 error code. To view the Win32 error code list, see the following Microsoft Web site:
Asp> http://msdn.microsoft.com/library/en-us/netdir/adsi/win32_error_codes.asp
For example, to manually register the Sample. ocx ActiveX control, type the following command at the MS-DOS prompt:
C: egsvr32.exe sample. ocx
Regsvr32.exe error message
The following lists RegSvr32 error messages and possible causes.
Unrecognized flag:/invalid_flag
The keysign or switch combination is ineffective (see "regsvr32.exe usage" in this document ).
No DLL name specified.
The. dll file name is not included (see "regsvr32.exe usage" in this document ).
Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
The Dllname Is Not A. dll or. ocx file. For example, enter regsvr32 wjview.exe to generate the 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, enter regsvr32 autoexec. bat to generate the error message.
Dllname was loaded, but the DllRegisterServer or DllUnregisterServer entry point was not found.
The Dllname may not be exported, or the memory may have a corrupted Dllname version. Consider using Pview to detect the file and delete it.
Dllname is not self-registerable or a specified upted version is in memory.
For example, if you type regsvr32 icwdial. dll, the error message is returned because the Icwdial. dll file cannot be registered by yourself. If you suspect a corrupted Dllname version exists in the memory, try restarting the computer or re-extracting the original version of the file. If you are running Windows NT, you may need to use the Kill or Pview tool in the Microsoft Windows NT Server 4.0 Resource Kit. For other information, click to view the following Microsoft Knowledge Base Article:
197155 how to terminate an isolated process
OleInitialize failed (or OleUninitialize failed ).
Regsvr32 must initialize the COM library before calling the required COM library function and uninitializing the library when it is disabled. If the attempt to initialize or uninitialize the COM library fails, these error messages will appear. For example, the Ole32.dll file may be corrupted or its version is incorrect.
LoadLibrary ("Dllname") failed. GetlastError returns 0x00000485
In Winerror. h, 0x00000485 = 1157 (ERROR_DLL_NOT_FOUND) indicates "A library file is not found to run the application ". For example, if the missing. dll file cannot be found after you type regsvr32 Missing. dll, the error message is returned.
LoadLibrary ("Dllname") failed. GetLastError returns 0x00000002
In Winerror. h, 0x00000002 = 2 (ERROR_FILE_NOT_FOUND) indicates "the system cannot find the specified file ". In other words, the system cannot find the relevant DLL. For example, if you type regsvr32 icwdial. dll and the Tapi32.dll (dependency) is missing, the error message is returned.
LoadLibrary ("dskmaint. dll") failed. GetLastError returns 0x000001f
In Winerror. h, 0x000001f = 31 (ERROR_GEN_FAILURE) indicates that "the device attached to the system cannot work normally ". This happens if you try to register the Win16. dll file. For example, if you type regsvr32 dskmaint. dll, the error message is returned.
DllRegisterServer (or DllUnregisterServer) in Dllname failed. The Returned Code is: String
Search for a string in Winerror. h.
Regsvr32.exe and dependencies
RegSvr32.exe depends on Kernel32.dll, User32.dll, and Ole32.dll files (in Windows NT, it also depends on Msvcrt. dll and Advapi32.dll files ). Regsvr32.exe loads the file you are trying to register or unregister and all its dependencies. If necessary files are missing or they are corrupted, the process may fail.
You can use Depends.exe to determine the dependencies of the file you are trying to register or unregister. Depends.exe is provided in both the Microsoft Windows 98 resource kit and the Microsoft Windows NT 4.0 Resource Kit support tool.
247024 Tools required ded with the Microsoft Windows 98 Resource Kit