使用批处理文件

|注册dll和ocx文件。 我在C dirve的文件夹中有dll和ocx文件,只想单击批处理文件进行注册
已邀请:
根据此Microsoft知识库文章: Regsvr32.exe的用法
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)
使用
Regsvr32.exe
时,它将尝试加载组件并调用其
DLLSelfRegister
函数。如果此尝试成功,则ѭ1将显示一个指示成功的对话框。如果尝试失败,则“ 1”将返回一条错误消息。这可能包括Win32错误代码。 因此,生成的批处理文件将是:
echo off 
Regsvr32 /s C:\\MyDLL.dll
exit

bab

试试这个批处理代码:
for %%f in (*.ocx *.dll) do regsvr32 %%f
打开记事本并粘贴代码,然后将文件另存为“ 7”并以管理员身份运行。
只要将
regsvr32
放在路径中,只需将
regsvr32 pathto.exe
放入批处理文件中即可。
您将希望以静默方式运行它,因为多个错误可能会导致explorer.exe出现问题 为(c:\\ windows \\ system32 * .dll)中的%x执行regsvr32 / s%x

要回复问题请先登录注册