windows - 使用批处理文件注册dll和ocx文件

标签 windows windows-xp

我在 c 盘的文件夹中有 dll 和 ocx 文件,我想通过单击批处理文件来注册

最佳答案

根据 this Microsoft knowledge base article :

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.


因此,生成的批处理文件将是:

echo off 
Regsvr32 /s C:\MyDLL.dll
exit

关于windows - 使用批处理文件注册dll和ocx文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5726678/

相关文章:

c# - "Write-Error"(在 Powershell 中编写,在 C# 中使用)有效但 Write-Debug 不起作用 - 为什么?

ruby-on-rails - 如何使用命令提示符在 Windows 7 上的 Sublime 中打开 ruby​​ gem?

windows - 模拟 MIDI 设备 - Windows

windows - 将部分结果命令存储到变量

visual-studio-2005 - 并行程序集、Windows 7 和 Visual Studio 2005

c - 设置DiGetDeviceRegistryProperty : "The data area passed to a system call is too small" error

windows - 断言失败 - 训练 Tesseract

Windows 资源管理器 - 删除上下文菜单中的条目

deployment - 以编程方式提升用户权限

java - Servlet 在访问网络驱动器时抛出文件未找到 excp