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?
ProgrammingMicrosoft Legacy OSScripting Languages

Avatar of undefined
Last Comment
David Lee

8/22/2022 - Mon
SOLUTION
David Lee

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER CERTIFIED SOLUTION
astangelo

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
David Lee

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.
ASKER
astangelo

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.
David Lee

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.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy