@rem Windows 2000 (NT 5.0)
@rem Windows XP (NT 5.1)
@rem Windows 2003 (NT 5.2)
@rem Windows Vista/2008 (NT 6.0)
@rem Windows 7/2008 R2 (NT 6.1)
REM detect Windows NT vs. 9x
echo %OS%
if "%OS%" == "Windows_NT" goto NT
goto Unsupport
:NT
REM determine build of NT (if necessary)
for /f "delims=[] tokens=2 " %%i in ( 'ver ') do set MyVer=%%i
for /f "tokens=2 " %%i in ( 'echo %MyVer% ') do set MyVer=%%i
for /f "tokens=1,2,3 delims=. " %%i in ( 'echo %MyVer% ') do (
set MajorVer=%%i
set MinorVer=%%j
set BuildNum=%%k
)