Clarification on Registry information...

There is a registry value that can determine if you are Running "XP Home",
"XP Pro", "W2K Advanced Server" , or "W2K Datacenter server", and it will
tell you if this system is even running Terminal Services...  This value,
used in conjunction with other keys can tell you what OS, and "sub-version"
(they call it Product Suite) you are running.

That reg key is...

HKLM\System\Control\ProductOptions\ProductSuite

This is also another helpful key:
HKLM\System\Control\ProductOptions\ProductOptions
-- tells you whether you are running Server or a client OS

This key is a REG_MULTI_SZ so if you want to go this route, and are using
Win32::Registry or Win32::TieRegistry, you may need to search on how to
break up the multi-valued entries.  The docs explain this pretty good.
As well, searching for ProductSuite on msdn.microsoft.com reveals a lot more
info on this topic, as well as the full version info spec including W9x
OSes.

But, I think that the WMI option is a much better way to go.

Steven

-----Original Message-----
From: Geaslin, Andrew - GPB [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 25, 2003 9:01 AM
To: [EMAIL PROTECTED]
Subject: RE: MS Win 2K Version


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
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to