Any suggestions?
Thanks!
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...
Thank You!
>.
>
> 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
>.
>