'this will create a file called ARV.vbs on remote system 'That file gets the Adobe Reader version from an AR DLL. 'Requires WMI for remote launch. 'A brute force approach. 7/1/2009 If WScript.Arguments.Count = 1 Then strComputer = WScript.Arguments(0) Else Dim WshShell Set wshShell = WScript.CreateObject("WScript.Shell") strComputer = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%") strComputer = InputBox("Check Adobe on what PC","Name?",strComputer) End If If strcomputer = "" Then WScript.Quit strComputer = UCase(strComputer) Set fso = CreateObject("Scripting.FileSystemObject") strScriptName="\\" & strComputer & "\c$\ARV.vbs" If fso.fileexists(strScriptName) Then fso.DeleteFile strScriptName, True 'Then write the remote script On Error Resume Next set oFile = fso.opentextfile(strScriptName, 8, true) If Err <> 0 Then MsgBox "Error. " & Err.Description WScript.Quit End If oFile.writeline ("'This is a temp file, you may delete it") oFile.writeline ("On Error Resume Next") 'Native dll for Reader oFile.writeline ("Set adobepdf = WScript.CreateObject(""AcroPDF.PDF"")") oFile.writeline ("If Err <> 0 Then ") oFile.writeline (" strARVer = 0") oFile.writeline ("Else") oFile.writeline (" strAR = adobepdf.GetVersions") oFile.writeline (" aAR = Split(strAR,"","")") oFile.writeline (" For i = 0 To UBound(aAr) -1") oFile.writeline (" strThisVer =Mid(aAR(i), InStr(aAr(i),""="")+1)") 'Higest version is reported version oFile.writeline (" If strThisVer > strARVer Then strARVer = strThisVer") oFile.writeline (" Next") oFile.writeline ("") oFile.writeline ("End If ") oFile.writeline ("") oFile.writeline ("Set fso = CreateObject(""Scripting.FileSystemObject"")") oFile.writeline ("strFileName=""c:\ARV.txt""") oFile.writeline ("If fso.fileexists(strFileName) Then fso.DeleteFile strFileName, True") oFile.writeline ("set oFile = fso.opentextfile(strFileName, 8, true)") oFile.writeline ("oFile.Write strARVer") oFile.writeline ("oFile.Close") oFile.writeline ("") oFile.close 'run remote script set objWMILocator = WScript.CreateObject("WbemScripting.SWbemLocator") set objWMIService = objWMILocator.ConnectServer(strComputer,"root\CIMv2") set objProcess = objWMIService.Get("Win32_Process") set objProcessStartup = objWMIService.Get("Win32_ProcessStartup") objProcessStartup.Properties_.Item("ShowWindow").Value = 0 set objMethod = objProcess.Methods_.Item("Create") set objProcessInfo = objMethod.InParameters.SpawnInstance_() With objProcessInfo.Properties_ .Item("CommandLine").Value = "cscript //b C:\arv.vbs" .Item("CurrentDirectory").Value = "C:\" .Item("ProcessStartupInformation").Value = objProcessStartup End With Set objReturnInfo = objProcess.ExecMethod_("Create", objProcessInfo) objReturnInfo.Properties_.Item("returnValue") Set oFile = Nothing strOutFile = Replace(strScriptName,".vbs",".txt") i= 0 'Wait for remote file While Not fso.FileExists(strOutFile) And i < 120 WScript.Sleep 500 i = i + 1 Wend If Not fso.FileExists(strOutfile) Then message = "Unable to determine version" Else 'Read remote file and report Set oFile = fso.OpenTextFile(strOutFile,1) S = oFile.ReadLine oFile.Close MsgBox "Adobe Acrobat Version: " & S, vbInformation + vbOKOnly,StrComputer End If 'File cleanup If fso.fileexists(strOutFile) Then fso.DeleteFile strOutFile, True If fso.fileexists(strScriptName) Then fso.DeleteFile strScriptName, True