How can I determine an Application path from a file extension?

Discussion in 'Scripting' started by DennyThury, Oct 19, 2006.

  1. DennyThury

    DennyThury Guest

    I'm writing a VB script application that needs to print documents created in
    various applications (such as Adobe Acrobat, MS Word, MS Excel, etc).

    The only way I see to do this is to run the application which created the
    document, specifying the print option. For example, for a Acrobat (PDF)
    document, I'd execute something like the following:
    "C:\Program Files\Adobe\Acrobat 7.0\Reader\AcroRd32.exe" /p /h docum.pdg

    My questions:
    1. Is there a better way to print these documents?

    2. How can/should I find the proper path for an application associated with
    a file extension?

    I can manually see what I'm looking for in the control panel
    Folder_Options/FileType. But I need to find this from within my VB Script.
    I'm sure its somewhere in the registery. Can anyone tell me a reliable
    registry path for Windows 2000 and/or Windows 2003?

    I think I'm willing to "hardcode" the base image (i.e. acrord32.exe or
    winword.exe), but I think I need to find the full path to the application. I
    cannot assume that PATH environ variable will have the application path
    specified. Also, if the server administrator upgrades the application, its
    pathname may change, and I don't want to have to modify the code under these

    DennyThury, Oct 19, 2006
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.