If you need to register .dll and .ocx files in a directory (and below), this little batch file should help you:
::you need to start this .cmd file with a
::parameter, to prevent an unintended start.
if %1$ == $ goto:eof
::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"
echo register %1
regsvr32 /s %1
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:
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)