@echo off

rem ********************************************************************************
rem *
rem * Add-Drivers-To-ADS.bat
rem *
rem * This file copies all the required drivers to the ADS Server to enable
rem * usage of remote servers by ADS.
rem *
rem *
rem ********************************************************************************


call msiadspt.bat
set SRC=%CD_ROM%\sguide\w2003drv\$oem$\$1\drv
set DEST=%ADS_PATH%\nbs\repository\User\PreSystem

:BEGIN

rem ********************************************************************************
rem * Check to see if the ServerGuide CD is present
rem ********************************************************************************

if not exist "%SRC%\drvset.ini" goto ERROR

rem ********************************************************************************
rem * Run dscan to generate the textmode drivers for ADS
rem ********************************************************************************

..\utils\win32\dscan.exe "%SRC%" /T:"%DEST%" /OW /W:1


rem ********************************************************************************
rem * Run ddcopy to copy the network drivers to the ADS server
rem ********************************************************************************
:DDCOPY

..\utils\win32\clini.exe "%SRC%\drvset.ini" /S:Main /I:ServerGuide Version /LT:7.4.12

if errorlevel 100 goto DDCOPY_2
if not errorlevel 1 goto DDCOPY_1
echo An error occurred running clini.exe on "%SRC%\drvset.ini".
echo.
goto ERROR

:DDCOPY_1

..\utils\win32\ddcopy.exe "%SRC%" "%DEST%" /ADS

goto DDCOPY_E

:DDCOPY_2

..\utils\win32\ddcopy.exe "%SRC%" "%DEST%" /C:Network

goto DDCOPY_E

:DDCOPY_E


        
goto END



:ERROR
echo The ServerGuide CD was not found. 
echo Please insert the ServerGuide CD
echo Or Press CTRL-C to cancel.
echo .
pause

goto BEGIN

:END
echo .
echo ADS Driver Integration Complete.
echo .
pause
