Link to home
Start Free TrialLog in
Avatar of astangelo
astangeloFlag for United States of America

asked on

HTA open file in native program

I am trying to create a menu that pops up when a cd is loaded, something that looks professional, without having to laydown money for software since this is a one-time project.

Someone here, in the EE, mentioned using an HTA file (http://msdn.microsoft.com/en-us/library/ms536496.aspx).  This seems like a great solution because I can lay the whole thing out like a webpage.

To that end, if anyone has a better suggestion of how to create a menu w/o purchasing software, I'm all ears.

Current Issue:
The menu is supposed to open up PDFs.  Everytime I click on a link, the file is loaded in a new Internet Explorer window.  I want it to open in that person's native PDF reader ("Acrobat Reader", "FoxIt", etc.).

How can I do this?
SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You're welcome.  The problem I see with the script from creatautoruncd.com is that it requires you to enter the name of the program that'll view the PDF file.  You mentioned that you want the PDF to be opened by "I want it to open in that person's native PDF reader ("Acrobat Reader", "FoxIt", etc.)"  That's not going to work with that script.  The script I provided uses the person's native PDF reader.
Avatar of astangelo

ASKER

No, it works fine.

Before, when I had it set up that an anchor's href was linked directly to a PDF file, the file would load in the Adobe (Acrobat) Reader's IE plug-in. (BTW, my default browser is Firefox, but, since the HTA loads as an IE environment, any regular link will try to load that file/link in a new IE window.)

The script I posted above, pulled from createautoruncd.com, launches your system's native app for that file type.

Perhaps you are thinking this because the run command calls "program\file.pdf" but that's because I put the PDF file (not app) in the "program" directory.  Perhaps not; by all means correct me.  Either way this seems to work (at least on computers running Windows).

Thanks again.
Ok, I stand corrected.  I should have tested before commenting.  I saw the "program" portion of the command and was thinking you would have to specify the program used to open the file.