Hi Howard, thanks for the response. This ought to be pretty simple, BUT...

I looked at Win32::GetOSVersion() several months ago but it doesn't seem to
differentiate between Win 2000 Svr and Pro. Here is a quick example that
provides the same output for both Svr and Pro. It doesn't appear to pull
SPMAJOR, SPMINOR, SUITEMASK, or PRODUCTTYPE. Am I missing something?

Thanks again, Sturdy

Example follows:

my @List = Win32::GetOSVersion();
foreach my $Item (@List)
{
        print "Item: $Item\n";
}
exit;

OUTPUT:
(STRING)        Item: Service Pack 4
(MAJOR) Item: 5
(MINOR) Item: 0
(BUILD) Item: 2195
(ID)            Item: 2

-----Original Message-----
From: Bullock, Howard A. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 07, 2006 2:14 PM
To: [EMAIL PROTECTED]; perl-win32-users
Subject: RE: Problem identifying Win32 Type

Why not use ...

Win32::GetOSVersion()
 
[CORE] Returns the list (STRING, MAJOR, MINOR, BUILD, ID), where the
elements are, respectively: An arbitrary descriptive string, the major
version number of the operating system, the minor version number, the
build number, and a digit indicating the actual operating system. For
the ID, the values are 0 for Win32s, 1 for Windows 9X/Me and 2 for
Windows NT/2000/XP/2003. In scalar context it returns just the ID.
Currently known values for ID MAJOR and MINOR are as follows:
    OS                    ID    MAJOR   MINOR
    Win32s                 0      -       -
    Windows 95             1      4       0
    Windows 98             1      4      10
    Windows Me             1      4      90
    Windows NT 3.51        2      3      51
    Windows NT 4           2      4       0
    Windows 2000           2      5       0
    Windows XP             2      5       1
    Windows Server 2003    2      5       2
    Windows Vista          2      6       0

On Windows NT 4 SP6 and later this function returns the following
additional values: SPMAJOR, SPMINOR, SUITEMASK, PRODUCTTYPE.
SPMAJOR and SPMINOR are are the version numbers of the latest installed
service pack.
SUITEMASK is a bitfield identifying the product suites available on the
system. Known bits are:

    VER_SUITE_SMALLBUSINESS             0x00000001
    VER_SUITE_ENTERPRISE                0x00000002
    VER_SUITE_BACKOFFICE                0x00000004
    VER_SUITE_COMMUNICATIONS            0x00000008
    VER_SUITE_TERMINAL                  0x00000010
    VER_SUITE_SMALLBUSINESS_RESTRICTED  0x00000020
    VER_SUITE_EMBEDDEDNT                0x00000040
    VER_SUITE_DATACENTER                0x00000080
    VER_SUITE_SINGLEUSERTS              0x00000100
    VER_SUITE_PERSONAL                  0x00000200
    VER_SUITE_BLADE                     0x00000400
    VER_SUITE_EMBEDDED_RESTRICTED       0x00000800
    VER_SUITE_SECURITY_APPLIANCE        0x00001000

The VER_SUITE_xxx names are listed here to crossreference the Microsoft
documentation. The Win32 module does not provide symbolic names for
these constants.
PRODUCTTYPE provides additional information about the system. It should
be one of the following integer values:
    1 - Workstation (NT 4, 2000 Pro, XP Home, XP Pro)
    2 - Domaincontroller
    3 - Server
_______________________________________________
Perl-Win32-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to