Jack
Thu Aug 07 16:00:19 CDT 2003
This will only work on the XP and W2K machines but that's all you need.
Just add error handling that will tell you that the machine is NT if the
script doesn't complete with 0.
Set dtmConvertedDate = CreateObject("WbemScripting.SWbemDateTime")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
Wscript.Echo "Caption: " & objOperatingSystem.Caption
Wscript.Echo "Version: " & objOperatingSystem.Version
Next
"Ace" <member35260@dbforums.com> wrote in message
news:3214813.1060286426@dbforums.com...
>
> Originally posted by Jc
> > I need a simple script that will work on NT, XP, and 2000 machines
> > that will
> > simply return the OS version, basically what I have is a
> > multiple OS (NT,
> > XP, 2K) enviroment, and I want to add into the login script a
> > script that
> > will retrieve the OS, I can do the rest into getting it into a
> > SQL DB..
> >
> >
> > Thanks!!
>
> I have been following this, as I need to do the same thing. The gettype
> utility version 4.0 only detects NT, 2000 (and their roles), and the
> newest version apparently only detects Windows XP & Windows 2003. Is
> there not a version or similar util that can detect ALL windows versions
> (NT thru 2003)? I assume there must be a new gettype version that
> includes the error codes for all these version, but cannot find it.
> please advise. Thank you.
>
> AR
>
> --
> Posted via
http://dbforums.com