Check Windows version on setup

Batch program to launch a setup with a Windows version check

 

@echo off
::cls
REM Identify OS.
REM Ver10=Win10, Ver6.3=Win8.1, Ver6.2=Win8, Ver6.1=Win7, Ver6.0=WinV
REM Ver6.0=WinV, Ver5.1=WinXp, Ver5.2=Win2003, 
ver | find /i "version 10." > nul
if %errorlevel%==0 goto Windows_10
ver | find /i "version 6.3." > nul
if %errorlevel%==0 goto Windows_8
ver | find /i "version 6.2." > nul
if %errorlevel%==0 goto Windows_8
ver | find /i "version 6.1." > nul
if %errorlevel%==0 goto Windows_7
ver | find /i "version 6.0." > nul
if %errorlevel%==0 goto Windows_7
ver | find /i "version 5.1." > nul
if %errorlevel%==0 goto Windows_7
ver | find /i "version 5.2." > nul
if %errorlevel%==0 goto Windows_7
ver | find /i "Windows 2000" > nul
if %errorlevel%==0 goto Windows_7

:Windows_10
:Run Windows 10 specific commands here.
echo Windows 10
xr17v35x_win10_single_installer.EXE
::PAUSE
goto exit

:Windows_8
:Run Windows 8 specific commands here.
echo Windows 8
xr17v35x_win81_single_installer.EXE
::PAUSE
goto exit

:Windows_7
:Run Windows 7 specific commands here.
echo Windows 7
xr17v35x_win7_single_installer.EXE
::PAUSE
goto exit

:exit

Laisser un commentaire