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
SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
ASKER CERTIFIED SOLUTION
Avatar of astangelo
astangelo
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of David Lee
David Lee
Flag of United States of America image

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
astangelo
Flag of United States of America image

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.
Avatar of David Lee
David Lee
Flag of United States of America image

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.
Microsoft Legacy OS
Microsoft Legacy OS

The Microsoft Legacy Operating System topic includes legacy versions of Microsoft operating systems prior to Windows 2000: All versions of MS-DOS and other versions developed for specific manufacturers and Windows 3/3.1, Windows 95 and Windows 98, plus any other Windows-related versions, and Windows Mobile.

55K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo