Asked on B&C Hospitality Systems


How to Register or Unregister a Service in Microsoft Windows

by Billy, 2 years ago on B&C Knowledgebase « B&C...

Answers

  • by William, 2 years ago

    Register or unregister a DLL.

    Syntax
    REGSVR32 [/U] [/S] [/C] [/I:[Command_Line]] DLL_Name

    REGSVR32 [/U] [/S] [/C] /N /I:[Command_Line] DLL_Name

    Key

    /u Unregister Server.
    /s Silent - no dialogue boxes.
    /c Console output.
    /n Don't call DllRegisterServer
    /i Call DllInstall (or DllUninstall if /u is specified)
    Command_Line An optional command line for DllInstall
    Examples

    Unregister (disable) XP Zip folders
    REGSVR32 /u C:\Windows\System32\zipfldr.dll

    Unregister (Disable) CAB file viewer:
    REGSVR32 /u C:\Windows\System32\cabview.dll

    Register (enable) XP Zip folders
    REGSVR32 zipfldr.dll

    Register (enable) CAB file viewer:
    REGSVR32 cabview.dll

    Register Windows Update DLLs (for those times when XP repair breaks Windows Update)
    regsvr32 /s wuapi.dll
    regsvr32 /s wuaueng1.dll
    regsvr32 /s wuaueng.dll
    regsvr32 /s wucltui.dll
    regsvr32 /s wups2.dll
    regsvr32 /s wups.dll
    regsvr32 /s wuweb.dll

    Register DAO 3.6 (Data Access Objects):

    REGSVR32 "C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL"
  • by William, 2 years ago

    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/Windows 7) folder.

    Note On a 64-bit version of a 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.
    Back to the top
    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 more information, click the following article number to view the article in the Microsoft Knowledge Base:
    193625 WinInet error codes (12001 through 12156)
    For example, to manually register a Sample.ocx ActiveX control, type the following command at command prompt:
    c:\regsvr32.exe sample.ocx
    Back to the top
    Regsvr32.exe error messages in Windows Vista and later
    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.
    Back to the top
    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. For additional information, click to view the following article in the Microsoft Knowledge Base:
    197155 How to kill an orphaned process
    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.

Answer this question on B&C Hospitality Systems