Whew!  I thought this was an easy one, but I just spent nearly an hour
finding out *any* way to find this out.  And here it is:

Look at the contents of the following registry value:

HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Control/ProductOptions/ProductTy
pe

It will have one of 3 values:

WinNT   -- Workstation (or Professional for Win2K)
ServerNT        -- Server 
LanmanNT        -- "Advanced Server" (but I found this on an NT PDC, too)

-----Original Message-----
From: Alan Dickey [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 7:50 AM
Cc: '[EMAIL PROTECTED]'
Subject: Re: Determining if a Windows Server?


"Hawley, Eric" wrote:
> 
> I need to be able to determine whether or not the computer that a script
is
> running on is a Windows NT or 2000 server or if it is not.  Does anyone
know
> how to do this? I tried looking at Win32::GetOSVersion() but this won't
> work.  I have tried searching on CPAN but haven't found anything.

how about $^O (see perldoc perlfunc)

-- 
Alan F. Dickey - Interaction and Realization
http://www.intac.com/~afdickey
mailto:[EMAIL PROTECTED]
VOX: 908-273-3232 Cell: 908-334-0932

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

Reply via email to