Skip to main content

[archive] Detect Windows 2003 Server

  • May 12, 2010
  • 3 replies
  • 0 views

[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

3 replies

[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
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 :).

[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
Thanks, Frosti. This seems to be just what I need.

[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
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