@echo off
echo echo Start of script - %0
echo.
echo Press any key to begin the OCX registration.
pause > nul

:CheckEXE
if exist "%windir%\system32\REGSVR32.EXE" goto File1
echo Unable to find "%windir%\system32\REGSVR32.EXE" - OCXs cannot be registered!
goto Quit

:File1
if not exist "%windir%\system32\MSCOMCTL.OCX" goto RegFile1
echo "%windir%\system32\MSCOMCTL.OCX" already exists!
goto File2

:File2
if not exist "%windir%\system32\TABCTL32.OCX" goto RegFile2
echo "%windir%\system32\TABCTL32.OCX" already exists!
goto Quit

:RegFile1
copy MSCOMCTL.OCX "%windir%\system32\MSCOMCTL.OCX"
"%windir%\system32\REGSVR32.EXE" /s "%windir%\system32\MSCOMCTL.OCX"
goto File2

:RegFile2
copy TABCTL32.OCX "%windir%\system32\TABCTL32.OCX"
"%windir%\system32\REGSVR32.EXE" /s "%windir%\system32\TABCTL32.OCX"
goto Quit

:Quit
echo End of script - %0
pause > nul
exit
