Solved

Batch file to start one program if found installed if not found start a different one

Posted on 2007-03-21
6
206 Views
Last Modified: 2010-04-16
My workstations have Adobe Reader and Adobe Standard installed on them.  The executable to open pdf files is acrobat.exe in Standard version and acrord32.exe in Reader version.  Both programs are needed on workstation to work with special applications.  However, one of these Windows 3rd party application uses a .bat file to start acrord32.exe to view or print the pdf file.  However, those workstations that have the Standard version installed this batch of course if not working.  I need to modify this batch file to have it check to see if acrobat.exe is installed and if it is start the program if not found to start acrord32.  This is what the batch file currently has:

:acrobat
if (%2) == (/V) goto viewpdf
start acrord32 %2 %3
goto end

:viewpdf
start acrord32 %3
goto end

Any help would be appreciated.
0
Comment
Question by:clpease
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 18763567
Hmm - why not let the OS choose?

:acrobat
if (%2) == (/V) goto viewpdf
start %2 %3
goto end

:viewpdf
start %3
goto end

Start should then open the PDF with the correct reader...
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 500 total points
ID: 18763603
Otherwise, assuming the installation target is the same...

:acrobat
if (%2) == (/V) goto viewpdf
if exist "%programfiles%\Adobe Acrobat 7.0\Reader\acrord32.exe" start acrord32 %2 %3 && goto end
acrobat %2 %3
goto end

:viewpdf
start acrord32 %3
goto end
0
 

Author Comment

by:clpease
ID: 18779530
The users I want to test this on have been out of the office.  I will have to wait until next week when they return.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 18779576
Alright...keep us posted. ;^)
0

Featured Post

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
AutoHotkey is an excellent, free, open source programming/scripting language for Windows. It started out as a keyboard/mouse macros product, but has expanded into a robust language. This article provides an introduction to it, with links to addition…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question