Provides the version number of the current Windows system.
WinVersion (level)
(i) level see below.
(i) Windows version number.
Level |
Returns |
||||||||||||||||||||||||||||||
0 |
(i) Minor version: returns the decimal part of the Windows version number; i.e. 1.0, 2.11, 3.0, etc. |
||||||||||||||||||||||||||||||
1 |
(i) Major version: returns the integer part of the Windows version number; i.e. 1.0, 2.11, 3.0, etc. |
||||||||||||||||||||||||||||||
2 |
(i) Build number |
||||||||||||||||||||||||||||||
3 |
(s) CSD version: returns a string indicating the latest service pack that has been installed (e.g., "Service Pack 1"), or a blank string ("") if no service pack has been installed. |
||||||||||||||||||||||||||||||
4 |
(i) Windows platform This is exactly the same as WinMetrics(-4), i.e.:
|
||||||||||||||||||||||||||||||
5
|
(s) Version string This is a string in the form: "platform-major-minor" where "platform" is one of the following:
|
||||||||||||||||||||||||||||||
6 |
Major version number of the latest Service Pack installed. |
||||||||||||||||||||||||||||||
7 |
Minor version number of the latest Service Pack installed. |
||||||||||||||||||||||||||||||
8 |
Bit flags that identify the product suites available on the system. This can be 0, or one or more of the following values, combined using the bitwise OR ('|') operator:
Note that you should not solely rely upon the '1' flag to determine whether Small Business Server has been installed on the system, as both this flag and the '32' flag are set when this product suite is installed. If you upgrade this installation to Windows Server, Standard Edition, the '32' flag will be unset, however, the '1' flag will remain set. In this case, this indicates that Small Business Server was once installed on this system. If this installation is further upgraded to Windows Server, Enterprise Edition, the '1' flag will remain set. |
||||||||||||||||||||||||||||||
9 |
Additional information about the system. This can be one of the following values:
|
||||||||||||||||||||||||||||||
11 |
Windows 10 ReleaseID which is the four digit version number associated with Windows 10 semiannual feature updates. Empty string on other versions of Windows. (ReleaseID is deprecated on Windows 11 and always returns "2009"). |
||||||||||||||||||||||||||||||
12 |
Windows 10/11 DisplayVersion which is the four character version string associated with Windows 10/11 feature updates. Empty string on other versions of Windows. |
Notes: A server that is also a domain controller is reported as '2', not '3'.
A blank string will be returned for levels 6 - 9 on unsupported Windows platforms.
To decipher between all Windows platforms. Use the function WinVersion(5) to tell which one you have:
Windows |
Platform |
Major |
Minor |
95 |
1 |
4 |
0 |
98 |
1 |
4 |
10 |
ME |
1 |
4 |
90 |
NT 3.51 |
2 |
3 |
51 |
NT 4 |
2 |
4 |
0 |
NT 2000 |
2 |
5 |
0 |
XP |
2 |
5 |
1 |
2003(server) |
2 |
5 |
2 |
Vista / 2008 |
2 |
6 |
0 |
7 / 2008 R2 |
2 |
6 |
1 |
8 / 2012 |
2 |
6 |
2 |
8.1 / 2012 R2 |
2 |
6 |
3 |
10 / 11 / 2016 / 2019 |
2 |
10 |
0 |
v = WinVersion(5)
Platform="Unknown"
if v=="1-4-0" then Platform="Windows 95"
if v=="1-4-10" then Platform="Windows 98"
if v=="1-4-90" then Platform="Windows ME"
if v=="2-3-51" then Platform="Windows NT 3.51"
if v=="2-4-0" then Platform="Windows NT 4.0"
if v=="2-5-0" then Platform="Windows 2000"
if v=="2-5-1" then Platform="Windows XP"
if v=="2-5-2" then Platform="Windows 2003 Server"
if v=="2-6-0" then Platform="Windows Vista / 2008"
if v=="2-6-1" then Platform="Windows 7 / 2008 R2"
if v=="2-6-2" then Platform="Windows 8 / 2012"
if v=="2-6-3" then Platform="Windows 8.1 / 2012 R2"
if v=="2-10-0" then Platform="Windows 10 / 11 / 2016 / 2019"
Message("Platform",platform)
minorver = WinVersion(0) majorver = WinVersion(1) buildver = WinVersion(2) csdver = WinVersion(3) Message("Windows Version", StrCat(majorver, ".", minorver, " ",buildver, " ", csdver))