How to detect wich version of Windows 2000 is running ?

G

Guest

Guest
Archived from groups: microsoft.public.win2000.advanced_server,microsoft.public.win2000.developer,microsoft.public.win2000.general,microsoft.public.win2000.registry (More info?)

Hello,

I want to know how I can detect the windows 2000 version (server / advanced
server / .....).

Any idea ?

Jean Lemaire.
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.advanced_server,microsoft.public.win2000.developer,microsoft.public.win2000.general,microsoft.public.win2000.registry (More info?)

Check out GetVersionEx() and make sure to pass a pointer to a
OSVERSIONINFOEX structure (not OSVERSIONINFO).

--
John Phillips
MVP - Windows SDK



"Jean Lemaire" <Jean.Lemaire@ping.be> wrote in message
news:uEdWoioNEHA.620@TK2MSFTNGP10.phx.gbl...
> Hello,
>
> I want to know how I can detect the windows 2000 version (server /
advanced
> server / .....).
>
> Any idea ?
>
> Jean Lemaire.
>
>
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.advanced_server,microsoft.public.win2000.developer,microsoft.public.win2000.general,microsoft.public.win2000.registry (More info?)

Jean Lemaire wrote:

> I want to know how I can detect the windows 2000 version (server /
> advanced server / .....).
Hi

Put e.g. this WMI script into a .vbs file:


'--------------------8<----------------------
strComputer = "." ' use "." for local computer

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")

For Each objOperatingSystem in colSettings
Wscript.Echo "OS Caption: " & objOperatingSystem.Caption
Next
'--------------------8<----------------------


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/community/scriptcenter/default.mspx
 
G

Guest

Guest
Archived from groups: microsoft.public.win2000.advanced_server,microsoft.public.win2000.developer,microsoft.public.win2000.general,microsoft.public.win2000.registry (More info?)

"Jean Lemaire" <Jean.Lemaire@ping.be> wrote in message
news:uEdWoioNEHA.620@TK2MSFTNGP10.phx.gbl...
> Hello,
>
> I want to know how I can detect the windows 2000 version (server /
advanced
> server / .....).
>
> Any idea ?
>
> Jean Lemaire.
>
>

Gettype.exe (Win2000 Resource Kit) sets the ErrorLevel
like so:

1 Windows NT Workstation
2 Windows 2000 Professional
3 Windows NT Server Non-Domain Controller
4 Windows 2000 Server Non-Domain Controller
5 Windows NT Server Domain Controller
6 Windows 2000 Server Domain Controller
7 Windows NT [Enterprise/Terminal] Server Domain Controller
8 Windows NT [Enterprise/Terminal] Server Non-Domain Controller