:: Register DLLs.cmd
:: 8/18/2014 jichi
@echo off
setlocal

title Register MODI DLLs

set modidll1=MDIVWCTL.DLL
set modidll2=MSPCORE.DLL

:: The else syntax with parenthesis could cause syntax error since CommonProgramFiles contains ()
if not "%CommonProgramFiles(x86)%"=="" set commpath=%CommonProgramFiles(x86)%
if "%CommonProgramFiles(x86)%"=="" set commpath=%CommonProgramFiles%

set modipath=%commpath%\Microsoft Shared\MODI\12.0

if not exist "%modipath%" goto err_notfound

regsvr32.exe "%modipath%\%modidll1%" -s


regsvr32.exe "%modipath%\%modidll2%" -s