@echo off
set root=%CD%

::Checking OS architechture.
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && set OSarch=32BIT || set OSarch=64BIT

echo.
echo Installing Intel(R) PRO/1000 LAN Adapter Software for Windows 7/8/8.1. Please wait...
echo.

if %OSarch%==32BIT ( 
	cd APPS\SETUP\SETUPBD\Win32
) else if %OSarch%==64BIT ( 
	cd APPS\SETUP\SETUPBD\Winx64
) else (
	goto ERROR
)

::Install driver in Silent mode.
SetupBD.exe /s

::Check return value.
if errorlevel 0 (
	echo Installation completed.
	goto END
) else (
	goto ERROR
)

:ERROR
echo.
echo Error: An error occured while installing the driver.
goto END

:END
cd %ROOT%
