(view source code of lstoffvw.vbs as plain text)
Option Explicit
If WScript.Arguments.Count > 0 Then Syntax
Dim colItems, objItem, objWMIService, strComputer, strName
strComputer = "."
Set objWMIService = GetObject( "winmgmts://" & strComputer & "/root/CIMV2" )
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Product", "WQL", 48 )
For Each objItem In colItems
strName = LCase( objItem.Name )
If InStr( strName, "microsoft office" ) Then
If InStr( strName, "viewer" ) Then
WScript.Echo Left( objItem.Name & Space( 56 ), 56 ) & Right( Space( 20 ) & objItem.Version, 20 )
End If
End If
Next
Sub Syntax( )
Dim strMsg
strMsg = vbCrLf _
& "LstOffVw.vbs, Version 1.00" _
& vbCrLf _
& "List all Office Viewers installed on the local computer" _
& vbCrLf & vbCrLf _
& "Usage: CSCRIPT.EXE //NoLogo LSTOFFVW.VBS" _
& vbCrLf & vbCrLf _
& "Note: This (WMI) query may take a couple of minutes to complete" _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" _
& vbCrLf _
& "http://www.robvanderwoude.com"
WScript.Echo strMsg
WScript.Quit 1
End Sub
page last modified: 2024-04-16; loaded in 0.0092 seconds