我在 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 itsDLLSelfRegister
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/