none
Get version of Adobe Reader

    Question

  • Why does Adobe have to be so difficult?? ARGH!! I want to query the currently installed version of Acrord32.exe and have it return the version number, but I don't want the file path statically in my script. Since we will be using the same script on computers that run Acrobat 9 and X, I don't want to use FSO like this:

    set file = objFSO.GetFile ("C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe")

    And I really don't want a lot if "if" getfile statements with different versions. That being said, I can pull the executable's file path using this code snippet:

    Const HKEY_LOCAL_MACHINE  = &H80000002
    strComputer = "."
    Set objRegistry = GetObject("winmgmts:\\" & _ 
        strComputer & "\root\default:StdRegProv")
     
    strKeyPath = "software\classes\acrobat\shell\open\Command"
    strValueName = ""
    objRegistry.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strvalue
    Wscript.Echo (strvalue)

    Unfortunately, it returns this value:

    "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe" /u "%1"

    If i could figure out a way to eliminate the /u "/%1", I'd be in business. Any ideas on how to get just the first part with the file path?

    Oh, have I mentioned my disdain for Adobe? :)

    

    Tuesday, November 13, 2012 3:36 PM

Answers

  • VBScript version of aforementioned WMIC command:


    Dim WMI
    Set WMI = GetObject("winmgmts://./root/CIMV2")
    Dim Collection, Item
    Set Collection = WMI.ExecQuery("select Name,Version from " _
      & "Win32_Product where Vendor like '%adobe%'")
    For Each Item In Collection
      WScript.Echo Item.Name & vbTab & Item.Version
    Next
    

    Another thing to note: The Win32_Product class only reports on applications installed via Windows Installer. If it wasn't installed using Windows installer, Win32_Product doesn't see it.

    Bill

    Tuesday, November 13, 2012 4:43 PM

All replies

  • You can use a script like this one to scan for installed applications and their versions:

    Auditing 32-Bit and 64-Bit Applications with PowerShell

    Bill

    Tuesday, November 13, 2012 4:05 PM
  • How about this:

    wmic product where "Vendor like '%Adobe%'" get Name, Version

    ?

    Grant Ward, a.k.a. Bigteddy

    Tuesday, November 13, 2012 4:18 PM
  • Thanks Bill, but I can't use Power Shell. We are auditing baseline images and can't install anything at all on them. Like I said, if I could figure out how to eliminate the last characters fo the registry key value, I'd be in business.
    Tuesday, November 13, 2012 4:19 PM
  • Hi Grant,

    I am using a pretty large vb script that checks file versions, hardware installed, and a host of other things. I'd like it to be inside the vb script.


    Tuesday, November 13, 2012 4:23 PM
  • Hi,

    You can use the WMI StdRegProv class in VBScript to read the registry for installed applications. See the aforementioned article for registry locations and 32/64-bit caveats.

    Bill

    Tuesday, November 13, 2012 4:32 PM
  • Well, just adjust the WMI query for VBS. (Not my game, Powershell is my thing).  Just query the win32_product class with VBS, and filter on "Vendor=%Adobe%", select the version.  Same principle.

    Bill, perhaps you could help with the VBS to query WMI?  I used to use Scriptomatic, but don't have it installed anymore.


    Grant Ward, a.k.a. Bigteddy

    Tuesday, November 13, 2012 4:35 PM
  • I don't use or recommend Win32_Product mainly because it's so glacially slow.

    I much prefer to read installed applications from the registry.

    Bill

    Tuesday, November 13, 2012 4:40 PM
  • VBScript version of aforementioned WMIC command:


    Dim WMI
    Set WMI = GetObject("winmgmts://./root/CIMV2")
    Dim Collection, Item
    Set Collection = WMI.ExecQuery("select Name,Version from " _
      & "Win32_Product where Vendor like '%adobe%'")
    For Each Item In Collection
      WScript.Echo Item.Name & vbTab & Item.Version
    Next
    

    Another thing to note: The Win32_Product class only reports on applications installed via Windows Installer. If it wasn't installed using Windows installer, Win32_Product doesn't see it.

    Bill

    Tuesday, November 13, 2012 4:43 PM
  • Thanks a ton Bill. I modified it slightly to ignore Flash and Shockwave.

    Set WMI = GetObject("winmgmts://./root/CIMV2")
    Dim Collection, Item
    Set Collection = WMI.ExecQuery("select Name,Version from " _
      & "Win32_Product where name like '%Adobe Reader%'")
    For Each Item In Collection
      WScript.Echo Item.Name & vbTab & Item.Version
    Next

    Tuesday, November 13, 2012 5:09 PM
  • Thanks to you too Grant
    Tuesday, November 13, 2012 5:10 PM