Hi,

I need a vbs to know if the OS is Windows 2000 or XP. Denpending on that I
have to run regfiles.

Thank you

Didier

Re: Windows 2000 or XP ? by Robert

Robert
Tue Mar 02 09:40:15 CST 2004

how about something like:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colSettings
if objOperatingSystem.caption= "Microsoft Windows XP Professional" then
msgbox ("This Is a XP")
Else
End If
Next

--
Robert Cohen
A legend in his own mind
--

"MuM" <dchavanne@hurni.ch> wrote in message
news:#qFUZYGAEHA.4012@tk2msftngp13.phx.gbl...
> Hi,
>
> I need a vbs to know if the OS is Windows 2000 or XP. Denpending on that I
> have to run regfiles.
>
> Thank you
>
> Didier
>
>



Re: Windows 2000 or XP ? by Torgeir

Torgeir
Tue Mar 02 18:40:50 CST 2004

MuM wrote:

> I need a vbs to know if the OS is Windows 2000 or XP. Denpending on that I
> have to run regfiles.

Hi

The quickest way is to use a registry read, take a look at the function
GetOsVersionNumber (and GetSPNumber for service pack level) here:

http://groups.google.com/groups?selm=3EB70B7E.12C8CE54%40hydro.com



--
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