Results 1 to 8 of 8
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    Is there a way for a batch file to detect if Adobe Reader is installed on a computer? At our local senior center I make up self-loading CDs that sutomatically put the student's lessons in a folder on their desktop. The lessons are all in PDF format. As part of the self-installation process I presently have Adobe Reader installation files that run, but I don't want them to run if the student's already have the Reader program installed. So I need some batch command like "IF Adobe Reader exists, then exit else install the reader."

  2. #2
    Lounger
    Join Date
    Dec 2009
    Location
    Toledo
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Im not exactly sure of the correct answer but...

    You knew there would be one.
    If while making the bat file it could be a good idea to check for the latest version.
    I cant tell you how to do that either, sorry.

    I just know that they have had some upgrades for some rather
    serious security issues.
    I think a compatibility check could be most helpful for the seniors.

    I have elderly parents and need to check on their computers well being from
    time to time.

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Trivial to find if it is installed!
    Code:
    dir "%ProgramFiles%\Adobe Reader" > nul && echo Adobe Reader installed & goto :eof
    If you want to be even more specific, look for %ProgramFiles%\Adobe Reader\Reader\AcroRd32.exe or something similar.

    To install Acrobat Reader using a BATch file, you'd need to look this one up. If I get a chance when I get home from work, I'll look too!
    BATcher

    Time prevents everything happening all at once...

  4. #4
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post
    Thanks for the idea. I actually have tried a variation using the expression
    if exist "C:\Documents and Settings\All Users\Start Menu\Programs\Adobe Reader*" goto EXIT
    Which works so far on XP. Of course, I have to assume that all students with XP have it installed on C, and that they haven't removed Adobe Reader from the Start Menu, but that's a pretty good guess.
    Next, however, I will have to see if this works on Vista and W7.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Quote Originally Posted by BATcher View Post
    Code:
    dir "%ProgramFiles%\Adobe Reader" > nul && echo Adobe Reader installed & goto :eof
    On my Vista computer it is in
    Code:
    C:\Program Files (x86)\Adobe\Reader 8.0
    Regards
    John



  6. #6
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by John Hutchison View Post
    On my Vista computer it is in
    Code:
    C:\Program Files (x86)\Adobe\Reader 8.0
    And probably with 9.0 in it for an up-to-date version.
    Maybe just look for the Adobe directory?

    It's this sort of consistency from software developers which makes it complicated to have something which covers every eventuality.
    I've already had to write code this very morning to cope with the possibility that a BATch file runs on a 64-bit server:

    Code:
    if defined ProgramFiles(x86) (
      set tcprog="%ProgramFiles(x86)%\TrueCrypt\TrueCrypt.exe"
      ) else (
      set tcprog="%ProgramFiles%\TrueCrypt\TrueCrypt.exe"
    )
    BATcher

    Time prevents everything happening all at once...

  7. #7
    Lounger
    Join Date
    Dec 2009
    Location
    Toledo
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Mine is a x86 version of Vista.
    Im not sure if Johns is or not.
    His may be x64 and thus it would be in the program files (x86)\adobe\reader 8.0

    Mine is showing program files\adobe\reader 9.0

    I dont think just looking for the adobe directory will be enough.
    With so many adobe products I believe that you will have to drill down to adobe\reader

    I also show a sub folder in the reader directory called updater 6 that has a XML file in it
    with the correct version info.
    Im not sure if that is common or not though.

  8. #8
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,421
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Quote Originally Posted by Chuck Tucker View Post
    Thanks for the idea. I actually have tried a variation using the expression
    if exist "C:\Documents and Settings\All Users\Start Menu\Programs\Adobe Reader*" goto EXIT
    Which works so far on XP. Of course, I have to assume that all students with XP have it installed on C, and that they haven't removed Adobe Reader from the Start Menu, but that's a pretty good guess.
    Next, however, I will have to see if this works on Vista and W7.
    Endless fun observable in Adobe's installation document...

    Your test (above) seems just as good as mine - provided it works for Vista and Windows 7.
    But beware that after NT4 an IF EXIST test for a directory name can be rather flaky, hence my test using DIR - return code is 1 if it doesn't work (no directory of that name), 0 if the directory is present...
    BATcher

    Time prevents everything happening all at once...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •