/ Published in: DOS Batch
built on work by Simon Sheppard, and Joey.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
@echo off :: from http://ss64.org/viewtopic.php?pid=3136#p3136 ::================================== ::variables :Main call :clean call :parse_cmdver call :ver%cmdver% call :Report goto :End :clean :: Ensure we don't inherit values from previous runs set _verCmd= set _verMajor= set _verMinor= set _verBuild= set _verWin= goto :eof :Parse_cmdver :: Turn "5.1.2306" string into actionable variables ) goto :eof :Report echo. echo. goto :eof :Report2 echo. set _ver goto :eof ::Table of version numbers built from :: http://en.wikipedia.org/wiki/Microsoft_Windows#Timeline_of_releases :ver1.01 set longver=Windows 1.01 set shortver=Win101 goto :eof :ver2.03 set longver=Windows 2.03 set shortver=Win203 goto :eof :ver2.10 set longver=Windows 2.10 set shortver=Win21 goto :eof :ver2.11 set longver=Windows 2.11 set shortver=Win211 goto :eof :ver3.0 set longver=Windows 3.0 set shortver=Win3 goto :eof :ver3.1 set shortver=Win31/WFW31/WinNT31 goto :eof :ver3.11 set shortver=WFW311 goto :eof :ver3.2 set shortver=Win32ch goto :eof :ver3.5 set longver=Windows NT 3.5 set shortver=WinNT35 goto :eof :ver3.51 set longver=Windows NT 3.51 set shortver=WinNT351 goto :eof :ver4.0.950 set longver=Windows 95 set shortver=Win95 goto :eof :ver4.0.1381 set longver=Windows NT 4.0 set shortver=WinNT4 goto :eof :ver4.90.3000 set longver=Windows Me set shortver=WinMe goto :eof :ver4.10.1998 set longver=Windows 98 set shortver=Win98 goto :eof :ver4.10.2222 set longver=Windows 98 SE set shortver=Win98SE goto :eof :ver5.0.2195 set longver=Windows 2000 set shortver=Win2K goto :eof :ver5.1.2600 set shortver=WinXP/WinFun goto :eof :ver5.2.3790 set longver=Windows XP, Windows XP Pro or Windows Server 2003 set shortver=WinXP/WinXP-Pro/Server2003 goto :eof :ver5.2.4500 set longver=Windows Home Server set shortver=WinHomeServer goto :eof :ver6.0.6002 set longver=Windows Vista or Windows Server 2008 set shortver=Vista/Server2008 goto :eof :ver6.1.7600 set longver=Windows 7 or Windows Server 2008 R2 set shortver=Win7/Server2008R2 goto :eof :End :: return version to calling shell/script, :: see http://ss64.com/nt/syntax-functions.html