批量注册dll或ocx文件

批量注册dll或ocx文件

------------------------------------------------------------------

批量注册system32下的dll文件

for %c in (%windir%/system32\*.dll) do regsvr32.exe /s %c

for %c in (c:\windows\system32\*.dll) do regsvr32.exe /s %c

for %c in (c:\windows\system32\*.ocx) do regsvr32.exe /s %c

for %c in (c:\windows\system32\UFCOMSQL\*.dll) do regsvr32.exe /s %c

for %c in (c:\windows\system32\UFCOMSQL\*.ocx) do regsvr32.exe /s %c

批量注册C:\U8SOFT\ufcomsql下的ocx文件

for %c in (C:\U8SOFT\ufcomsql\*.ocx) do regsvr32.exe /s %c

批量注册C:\U8SOFT\ufcomsql下的dll文件

for %c in (C:\U8SOFT\ufcomsql\*.dll) do regsvr32.exe /s %c

------------------------------------------------------------------

FOR --循环语句

% --DOS里面,变量前面都要带%

/s 静默方式,不然没注册一个dll都会弹出一个警告框,然后你要一个一个点

整个语句就是注册C:\window\system32目录下面的所有dll,这晚晚能够解决一些莫名其妙的问题

------------------------------------------------------------------

regsvr32.exe是32位系统下使用的DLL注册和反注册工具,使用它必须通过命令行的方式使用,格式是:

  regsvr32 [/u] [/s] [/n] [/i[:cmdline]] DLL文件名

  命令可以在“开始→运行”的文本框中,也可以事先在bat批处理文档中编写好命令。未带任何参数是注册DLL文件功能,其它参数对应功能如下:

  /u:反注册DLL文件;

  /s:安静模式(Silent)执行命令,即在成功注册/反注册DLL文件前提下不显示结果提示框。

  /c:控制端口;

  /i:在使用/u反注册时调用DllInstall;

  /n:不调用DllRegisterServer,必须与/i连用。

  单独运行regsvr32.exe程序,可以看到弹出一“No DLL name specified”的错误提示框

原文地址:https://www.cnblogs.com/cuihongyu3503319/p/1818987.html