Jonathan Chan wrote:

> hi guys,
> 
> i'm using a function that looks at a client's registry to determine which 
> windows os a box is running. i can easily easily determine if a machine is 
> nt, 2000, or xp. does anyone have a way of determining if a box is either 
> running nt server or nt workstation?

My snippets on version info etc:

use constant VER_PLATFORM_WIN32s => 0;          # Win32s on Windows 3.1
use constant VER_PLATFORM_WIN32_WINDOWS => 1;   # Windows 95, 98, or Me.
use constant VER_PLATFORM_WIN32_NT => 2;        # NT, 2000, XP or Server 2003

my %maj_min_id = (
  3 => { 51 => { 0 => 'Windows NT 3.51' }, },
  4 => {  0 => { 1 => 'Windows 95',
                 2 => 'Windows NT 4.0' },
         10 => { 1 => 'Windows 98' },
         90 => { 1 => 'Windows Me' }, },
  5 => {  0 => { 2 => 'Windows 2000' },
          1 => { 2 => 'Windows XP' },
          2 => { 2 => 'Windows Server 2003' }, },
);

my ($str, $maj, $min, $bld, $id) = Win32::GetOSVersion();
print "\nOS Version = $maj_min_id{$maj}{$min}{$id} - $str; Build $bld\n\n";

my $mach = Win32::NodeName;
print "NodeName = $mach\n\n";

my $domain = Win32::DomainName();
print "domain = $domain\n\n";

use Win32;      # need for GetOSName
my @osname = Win32::GetOSName();        # deprecated ??
print "Win32::GetOSName() = "; # '@osname'\n";
foreach (@osname) {
        print "'$_' ";
}
print "\n";

# useful env variables

print "\nENV:\n";
my @envs = qw(COMPUTERNAME HOSTTYPE LOGONSERVER NUMBER_OF_PROCESSORS OS OSTYPE
  PROCESSOR_ARCHITECTURE PROCESSOR_IDENTIFIER PROCESSOR_LEVEL
  PROCESSOR_REVISION ProgramFiles SESSIONNAME SystemDrive SystemRoot temp tmp
  USERDOMAIN USERNAME USERPROFILE windir);

foreach (@envs) {
        print "$_ => $ENV{$_}\n" if exists $ENV{$_};
}

__END__


-- 
  ,-/-  __      _  _         $Bill Luebkert    Mailto:[EMAIL PROTECTED]
 (_/   /  )    // //       DBE Collectibles    Mailto:[EMAIL PROTECTED]
  / ) /--<  o // //      Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_</_</_    http://dbecoll.tripod.com/ (My Perl/Lakers stuff)

_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to