PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

Determining W2K version?

 
 
Peter Hurford
Guest
Posts: n/a
 
      8th Jan 2008
Hi,

The .net framework's Environment.OSVersion.Version......

api is fine and straightforward to get me to the main Windows
versions, but I note that it seems unable to differentiate between W2K
Pro, W2K Server etc. etc.

Can anyone remember how to do this?

Thanks,
Peter Hurford
 
Reply With Quote
 
 
 
 
Mattias Sjögren
Guest
Posts: n/a
 
      8th Jan 2008
>The .net framework's Environment.OSVersion.Version......
>
>api is fine and straightforward to get me to the main Windows
>versions, but I note that it seems unable to differentiate between W2K
>Pro, W2K Server etc. etc.
>
>Can anyone remember how to do this?


You can call GetVersionEx with PInvoke to get that information.

http://msdn2.microsoft.com/en-us/library/ms724451(VS.85).aspx
http://support.microsoft.com/kb/304721

The code in the KB article uses the OSVERSIONINFO struct, you need to
use the extended OSVERSIONINFOEX instead and check wProductType.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
 
Reply With Quote
 
Peter Hurford
Guest
Posts: n/a
 
      9th Jan 2008
Mattias, thanks for your response.

Actually the way I found to do it was slightly different, although was
seemingly at one point in time Microsoft's "recommended" approach.

The key HKLM\System\CurrentControlSet\Control\ProductOptions contains
the ProductType value

This is WinNT (Workstation), ServerNT (standalone server) or LanmanNT
(Domain Controller)

These values appear to be both backward and forward compatible also,
for example they will work with NT4 & NT3.51, but also the two server
values appear good for W2K3 also (though of course if the framework
can give this information it will be far cleaner).

See http://support.microsoft.com/?kbid=152078 for more info.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Determining Cat Version? Harkhof ATI Video Cards 4 30th Sep 2006 01:11 AM
Determining version of a DLL Richard L Rosenheim Microsoft VB .NET 2 23rd Jan 2005 02:45 AM
Determining IIS version Mike Schilling Microsoft C# .NET 3 7th Aug 2004 10:02 PM
Determining .mdb version Kevin Harris Microsoft Access VBA Modules 3 10th Apr 2004 06:38 AM
Determining OS Version Microsoft VC .NET 2 11th Nov 2003 02:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:00 AM.