If your running Win2k you can use WMI. It correctly differentiates between server, advanced server and professional versions (I don't have datacenter).
The registry values seem to simply tell you that you are running Win2k not which version.
 
hth,
-Andrew
 
<CODE>
 
use strict;
use warnings;
use Win32::OLE qw( in );
use Win32::OLE::Variant;
 
my $host = shift @ARGV || Win32::NodeName();
my $WMI;
eval
   {  my $class = "WinMgmts:{impersonationLevel=impersonate}!//$host";
      unless ($WMI = Win32::OLE->GetObject( $class ))
         {  print "Error creating WMI Object on $host \n";
         }
 
      ## WMI looks good so execute the OS query
      my $OSdata = $WMI->ExecQuery("SELECT * FROM Win32_OperatingSystem");
      foreach my $item (in $OSdata)
         {  print "$host is running $item->{Caption} - $item->{Version}\n";
         }
   }; print "$host die with WMI Error\n" if $@;
 
</CODE>
-----Original Message-----
From: LViale - TiscaliNet [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 3:08 PM
To: [EMAIL PROTECTED]
Subject: MS Win 2K Version

Subject: MS Win 2K Version
 
Hi all
Does someone know how to get from registry the exact version of MS Win 2k (Professional, Server, Advanced Server, ...).
I found references and Perl--functions useful to get the Build and Service Pack Level, but not the OS Type (Pro, Srv, Adv srv, ...).
Thanks for your support.
Bye. Lorenzo


This message is for the named recipient only. It may contain confidential, proprietary or legally privileged information. If the reader of this message is not the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by email and delete the original message from your computer. We reserve the right to monitor all email communications. Although we believe this email and any attachments are virus-free, we do not guarantee that it is virus-free, and we accept no liability for any loss or damage arising from its use.

GREENPOINT

Reply via email to