@echo OFF
setlocal

if not exist \\P26326\SETUPS\GUIClients\Shared goto notavailable

echo Unregister ...

if exist %INSTROOT%\pgm\SAPDBxTraceServer.dll		regsvr32 /u /s %INSTROOT%\pgm\SAPDBxTraceServer.dll
if exist %INSTROOT%\pgm\SAPDBxDBCOM.dll				regsvr32 /u /s %INSTROOT%\pgm\SAPDBxDBCOM.dll
if exist %INSTROOT%\pgm\SAPDBxCommon.dll			regsvr32 /u /s %INSTROOT%\pgm\SAPDBxCommon.dll
if exist %INSTROOT%\pgm\SAPDBxRegLib.dll			regsvr32 /u /s %INSTROOT%\pgm\SAPDBxRegLib.dll

echo Copy ...

if not exist %INSTROOT%\pgm\ mkdir %INSTROOT%\pgm\

xcopy /D \\P26326\SETUPS\GUIClients\Shared\SAPDBxTraceServer.dll	%INSTROOT%\pgm\
xcopy /D \\P26326\SETUPS\GUIClients\Shared\SAPDBxDBCOM.dll			%INSTROOT%\pgm\
xcopy /D \\P26326\SETUPS\GUIClients\Shared\SAPDBxCommon.dll			%INSTROOT%\pgm\
xcopy /D \\P26326\SETUPS\GUIClients\Shared\SAPDBxRegLib.dll			%INSTROOT%\pgm\

echo Register ...

if exist %INSTROOT%\pgm\SAPDBxTraceServer.dll		regsvr32 /s %INSTROOT%\pgm\SAPDBxTraceServer.dll
if exist %INSTROOT%\pgm\SAPDBxDBCOM.dll				regsvr32 /s %INSTROOT%\pgm\SAPDBxDBCOM.dll
if exist %INSTROOT%\pgm\SAPDBxCommon.dll			regsvr32 /s %INSTROOT%\pgm\SAPDBxCommon.dll
if exist %INSTROOT%\pgm\SAPDBxRegLib.dll			regsvr32 /s %INSTROOT%\pgm\SAPDBxRegLib.dll

echo ###################
echo    Enjoy DBCOM !
echo ###################

goto installend

:notavailable

echo ###################################
echo    DBCOM not properly installed!
echo ###################################

:installend

endlocal
