WMI version 
Author Message
 WMI version

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!



Mon, 01 Aug 2005 02:11:22 GMT  
 WMI version
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


Quote:
> 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!



Mon, 01 Aug 2005 02:21:02 GMT  
 WMI version
I will give that a shot...

Thank You!

Quote:
>-----Original Message-----
>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



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

>.



Mon, 01 Aug 2005 02:24:26 GMT  
 WMI version

Quote:

>  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



Mon, 01 Aug 2005 02:40:27 GMT  
 WMI version
That is even better...  Thanks to all for the response!

James

Quote:
>-----Original Message-----

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

- Show quoted text -

Quote:

>.



Mon, 01 Aug 2005 03:19:03 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. WSH, ADSI and WMI versions?

2. WMI sdk 2001 versus previous versions

3. WMI and operting system version

4. WMI REQ: Query 'file version' info using WMI?

5. wmi core and wmi sdk...

6. Strange behavior of VBscript/WMI into ASP (compared to VBscript/WMI into client-side application)

7. Get the system version Windows version

8. other versions than the American version of VBScript?

9. Version information incorrect for version 5.5?

10. WScript.Version - cannot convert on international version of NT

11. How to compare two file versions and dio update if newer version is available

12. VB script version / browser version

 

 
Powered by phpBB® Forum Software