rem Find Windows Version

 

@echo off

:WinVersion

echo ###### Discovering Windows Version ######

 

ver | find /i "4.0"

if %ERRORLEVEL% EQU 0 (

echo "Windows 4.0 (WinNT) detected"

goto BADVER

)

 

ver | find /i "5.0"

if %ERRORLEVEL% EQU 0 (

echo "Windows 5.0 (Win2k) detected"

goto BADVER

)

 

ver | find /i "5.1"

if %ERRORLEVEL% EQU 0 (

echo "Windows 5.1 (WinXP) detected"

goto WinXP

)

 

ver | find /i "5.2"

if %ERRORLEVEL% EQU 0 (

echo "Windows 5.2 (Win2k3) detected"

goto Win2k3

)

 

ver | find /i "6.0"

if %ERRORLEVEL% EQU 0 (

echo "Windows 6.0 (Win2k8) detected"

goto Win2k8

)

 

ver | find /i "6.1"

if %ERRORLEVEL% EQU 0 (

echo "Windows 6.1 (Win2k8 R2 or Windows 7) detected"

goto Win7

)



ver | find /i "6.2"

if %ERRORLEVEL% EQU 0 (

echo "Windows 6.2 (Win2k12) detected"

goto Win2k8

) 



goto BADVER

 

:WinXP

if %PROCESSOR_ARCHITECTURE% EQU x86 MemRwinstallw2k332.bat else goto BADARCH

goto END

 

:Win2k3

if %PROCESSOR_ARCHITECTURE% EQU x86 MemRwinstallw2k332.bat else (

    if %PROCESSOR_ARCHITECTURE% EQU AMD64 MemRwinstallw2k364.bat else goto BADARCH

)

goto END

 

:Win2k8

:Win7

if %PROCESSOR_ARCHITECTURE% EQU x86 MemRwinstallw2k832.bat else (

    if %PROCESSOR_ARCHITECTURE% EQU AMD64 MemRwinstallw2k864.bat else goto BADARCH

)

goto END

 

 

:BADARCH

echo "Sorry, MemRW does not support Windows %PROCESSOR_ARCHITECTURE% architecture"

goto END

 

:BADVER

echo "Sorry, MemRW does not support this version of Windows"

goto END

 

 

:END

