Jump to content

Running an application without specifying its full path


pr1
 Share

Recommended Posts

Hello,

is there a way to run a third-party Windows application (such as Acrobat Reader, AcroRd32.exe) without specifying its full path?

For instance, I would like to do this:

Run <or any other command>("AcroRd32.exe", "", ...)

instead of

Run("C:\Program Files\Adobe\Reader 9.0\Reader\AcroRd32.exe", "", ...).

Like that, I could call any version of Acrobat Reader (7, 8, or 9) on any machine, without knowing its full path.

Many thanks.

pr1

Link to comment
Share on other sites

I just did it with Firefox and it worked fine. Run("Firefox.exe"). I don't have Acrobat Reader or I'd test that for you.

Edit: It fails for Foxit Reader.

Ok well, I'm done, sorry.

*facePALM* Maybe it worked for Firefox becuase I already had it open?

Edited by jaberwocky6669
Link to comment
Share on other sites

pr1, Unless its added to the initial 'Path' environment string, you'll need to put the full path in. If you want it to be able to be run on other configurations though (where it could be installed to a different folder), you might want to search the registry for any keys that point to the folder and/or executable, and use the path found there.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...