Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

WMI version

0 views
Skip to first unread message

James

unread,
Feb 12, 2003, 1:11:22 PM2/12/03
to
I need to test if WMI is installed and what version on our
NT machines. I have searched the script center and not
found anything. All the scripts I found use wmi to return
the version and that will not help if wmi is not installed
to begin with...

Any suggestions?

Thanks!

Joe Earnest

unread,
Feb 12, 2003, 1:21:02 PM2/12/03
to
Hi,

Well actually, if you just error trap the WMI version
method that you have, it'll tell you if WMI is installed
and accessible.

On Error Resume Next
...
If Err Then Err.Clear: ... ' not installed
On Error GoTo 0

Joe Earnest

"James" <jgw...@dot.state.az.us> wrote in message
news:008a01c2d2c2$26073490$a401...@phx.gbl...

James

unread,
Feb 12, 2003, 1:24:26 PM2/12/03
to
I will give that a shot...

Thank You!

>.
>

Torgeir Bakken (MVP)

unread,
Feb 12, 2003, 1:40:27 PM2/12/03
to
"James" <jgw...@dot.state.az.us> wrote:

> I need to test if WMI is installed and what version on our
> NT machines. I have searched the script center and not
> found anything. All the scripts I found use wmi to return
> the version and that will not help if wmi is not installed
> to begin with...

The existence of <windows system dir>\WBEM\Wbemcore.dll is one way to test (and
get the version):

With a vbscript:

' Gets current version of WMI
' using file versions
' A value of 0 indicates not installed

Set oFSO = CreateObject("scripting.FileSystemObject")
sWinSysDir = oFSO.GetSpecialFolder(1).Path & "\"

sFile = "WBEM\wbemcore.dll"
sWmiCurrVer = "0"
If oFSO.FileExists(sWinSysDir & sFile) Then
sWmiCurrVer = oFSO.GetFileVersion(sWinSysDir & sFile)
End If
WScript.Echo sFile & " :" & sWmiCurrVer

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


James Wood

unread,
Feb 12, 2003, 2:19:03 PM2/12/03
to
That is even better... Thanks to all for the response!

James

>.
>

0 new messages