如何使用Regsrv32命令注册和注销Windows DLL文件

本文介绍了如何使用Regsrv32命令在Windows系统中注册和注销DLL文件,包括命令的语法、需要管理员权限的操作步骤、DLL文件的位置以及如何在不显示对话框的情况下执行操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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 actions

    OPTINONS用于提供不同的动作

  • DLL is the path with the name of DLL file

    DLL是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。

Open MS-DOS or Powershell with Administrator Privileges
Open MS-DOS or Powershell with Administrator Privileges
使用管理员权限打开MS-DOS或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
LEARN MORE  What Version Of Windows Do I Have?
了解更多我拥有什么版本的Windows?

翻译自: https://www.poftut.com/register-and-unregister-windows-dll-files-with-regsrv32-command/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值