Highlighted
Absent Member.
Absent Member.
270 views

[archive] Detect Windows 2003 Server

[Migrated content. Thread originally posted on 11 May 2010]

I'm looking for a simple way to detect whether the runtime is on a Windows 2003 Server or not. Has anyone done this? I'll probably be in need of the same for Windows 2008.

Thanks,
Rob
0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

RE: [archive] Detect Windows 2003 Server

Read the Registry:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion

In "BuildLab" you can Unstring the WinVersion from it:
XP-Example: 2600.xpsp.080413-2111
2003-Example: 3790.srv03_sp2_gdr.091215-1207
Vista-Example: 6002.vistasp2_grd.100218-0019
» the first 4 Numbers are the Build-Number

Or use "CurrentVersion"
5.0 = Windows2000
5.1 = WindowsXP
5.2 = Windows2003
6.0 = Vista

Windows2008 i can't check, sorry - have no 2008-Server :).
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Detect Windows 2003 Server

Thanks, Frosti. This seems to be just what I need.
0 Likes
Highlighted
Absent Member.
Absent Member.

RE: [archive] Detect Windows 2003 Server

I've discovered that you can also do this using:

CALL "WIN$VERSION" USING WINVERSION-DATA.

The WIN-MAJOR-VERSION will contain a 5 and the WIN-MINOR-VERSION will contain a 2 for Windows 2003. So, it matches exactly with the "CurrentVersion".

Rob
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.