Dynamic Link Libraries provides helper libraries to the applications. Dynamic Link Libraries also called DLL. DLL’s provides reusable libraries, data and code which can be used by multiple applications or executables. In order to use system wide DLL’s easily we should register them. regsrv32
is a tool used to register DLL’s to the operating system.
动态链接库为应用程序提供了帮助程序库。 动态链接库也称为DLL。 DLL提供了可重用的库,数据和代码,可以由多个应用程序或可执行文件使用。 为了轻松使用系统范围的DLL,我们应该对其进行注册。 regsrv32
是用于将DLL注册到操作系统的工具。
句法 (Syntax)
Syntax of regsrv32
is like below.
regsrv32
语法如下。
regsrv32 OPTIONS DLL
OPTINONS
are used provide different actionsOPTINONS
用于提供不同的动作DLL
is the path with the name of DLL fileDLL
是DLL文件名称的路径
使用管理员权限打开MS-DOS或Powershell(Open MS-DOS or Powershell with Administrator Privileges)
Playing with DLL’s in windows operating system requires Administrator privileges. So we will register and unregister DLL’s where we need a shell like MS-DOS or Powershell with Administrator privileges. In this example we will open MS_DOS shell with Administrator rights just clicking Run as administrator
menu. The same technique can be used for Powershell too.
在Windows操作系统中播放DLL需要管理员权限。 因此,我们将在需要具有管理员特权的MS-DOS或Powershell之类的外壳的情况下注册和注销DLL。 在此示例中,我们将以管理员权限打开MS_DOS shell,只需单击Run as administrator
菜单。 同样的技术也可以用于Powershell。

找到并运行Regsrv32可执行文件 (Locate and Run Regsrv32 Executable)
regsrv32
is not in path environment variables path. It is found following directories.
regsrv32
不在路径环境变量path中。 在以下目录中找到它。
For 32 bit Windows
%systemroot%\SysWoW64\regsvr32.exe
对于32位Windows
%systemroot%\SysWoW64\regsvr32.exe
For 64 bit Windows
%systemroot%\System32\regsvr32.exe
对于64位Windows
%systemroot%\System32\regsvr32.exe
We can access just like below for 64 bit Windows.
对于64位Windows,我们可以像下面一样访问。
> %systemroot%\SysWoW64\regsvr32.exe
注册DLL (Register DLL)
Now the main operation with regsrv32
is registering DLL. We do not need any option to specify to register a DLL. We will just provide the DLL name. In this example we register DLL named cabview.dll
which resides in C:\DLL
. Here we assume we have added %systemroot%\SysWoW64
in to the path variable
现在,使用regsrv32
的主要操作是注册DLL。 我们不需要任何选项来指定注册DLL。 我们将只提供DLL名称。 在此示例中,我们注册了一个名为cabview.dll
DLL,它位于C:\DLL
。 在这里,我们假设已将%systemroot%\SysWoW64
添加到path变量中
> regsrv32 C:\DLL\cabview.dll
注销DLL (Unregister DLL)
We can unregister already registered DLL with \u
option. We will unregister cabview.dll
in the following example.
我们可以使用\u
选项取消注册已经注册的DLL。 在下面的示例中,我们将注销cabview.dll
。
> regsrv32 \u C:\DLL\cabview.dll
不显示对话框 (Do Not Display Dialogue Boxes)
By default regsrv32
command outputs as dialog boxes. This may be unnecessary or distracting. We can prevent the dialog box to display with /s
option. This options means silent.
默认情况下, regsrv32
命令输出为对话框。 这可能是不必要的或分散注意力。 我们可以防止对话框显示带有/s
选项。 此选项表示无声。
> regsrv32 /s C:\DLL\cabview.dll
翻译自: https://www.poftut.com/register-and-unregister-windows-dll-files-with-regsrv32-command/