If you need to register .dll and .ocx files in a directory (and below), this little batch file should help you:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | @echo off ::you need to start this .cmd file with a ::parameter, to prevent an unintended start. if %1$ == $ goto:eof setlocal ::comment this line out when you want to call regall.cmd from ::a different directory and register all the files in the CURRENT ::directory. If you leave this line uncommented regall.cmd will ::register all files in the directory where regall.cmd is stored! cd /d %0.. for /f “tokens=*” %%i in (‘dir *.dll;*.ocx /b /s’) do call :REGIT “%%i“ goto :eof :REGIT echo register %1 regsvr32 /s %1 goto:eof |
If you need to uninstall those files, you only need to change “regsvr32 /s %1″ to “regsvr32 /u /s %1″
Or if you like it simple and small:
1 2 3 | for %i in (*.dll;*.ocx) do regsvr32 /s %i (all *.dll and *.ocx files in the current directory) for /D %i in (*) do echo %i (show all directory names in the current directory) for /R %i in (*.dll;*.ocx) do regsvr32 /s %i (all *.dll and *.ocx files in the current directory and below this directory, r=recursive) |
