@echo off

cd /d %~dp0

REM Datei aus Systemverzeichnis beschaffen.
del /F .\silabser.sys  2>nul >nul
copy "%windir%\System32\Drivers\silabser.sys" silabser.sys  2>nul >nul

REM Datei analysieren
for /f "Tokens=5" %%a in ('.\Bin\filever ./silabser.sys') do set version=%%a

REM Entscheiden, welche Version des Treibers verwendet wird.
if "%version%" == "6.5.0.0" GOTO :65
if "%version%" == "6.3.0.0" GOTO :63
if "%version%" == "5.3.0.0" GOTO :53

GOTO :UNKNOWN

:53
echo driver version 5.3
call .\5.3\USB3Update.exe 
GOTO :END

:63
echo driver version 6.3
call .\6.3\USB3Update.exe 
GOTO :END

:65
echo driver version 6.5
call .\6.5\USB3Update.exe 
GOTO :END

:UNKNOWN
echo "Unknown driver version: "
echo %version%

goto :END


:END
del /F .\silabser.sys  2>nul >nul
