Arrrghmatey Posted August 29, 2005 Posted August 29, 2005 Hello, I have a program that reads information from a file, and dumps it into a HTML table, then opens the file in IE. I want to be able to have the name of the file a click-able link, where it opens that file in a specific program. Because this is not the default program to open this file type, I cannot figure out how to open it with the specific client side program. Is this possible at all? Thanks!
therks Posted August 29, 2005 Posted August 29, 2005 Have a look at this page. Specifically the Run Protocol. It might help you out. My AutoIt Stuff | My Github
Arrrghmatey Posted August 29, 2005 Author Posted August 29, 2005 This is what I'm using right now: <script> function LaunchApp() { if (!document.all) { alert ("Available only with Internet Explorer."); return; } var ws = new ActiveXObject("WScript.Shell"); ws.Exec("C:\\Program Files\\ezdicom\\StandAlone\\ezDicom.exe"); } </script> <a href="javascript:LaunchApp()">Launch the executable</a> But it launches the program. I can't seem to figure out how to launch a FILE in the program... Ideally I won't have to install anything, as this will be ported around to other computers here.
AutoChris Posted August 29, 2005 Posted August 29, 2005 What I did when I had to launch an app from IE was to have the link pop up a specific message box and then when AutoIt saw the message box, it would launch the app and the file using the Run() command. A pop-up like "Please wait while Word loads" or something similar works nicely. However, I am pretty low-tech in my scripts so I am sure there are better ideas out there.
Arrrghmatey Posted August 29, 2005 Author Posted August 29, 2005 I figured out a solution. I was using " where I should have been using '. in case anyone else wants it, here's my code: <script LANGUAGE="javascript" TYPE="text/javascript" > function PROCTest(imgPath) { var path = '\"C:\\Program Files\\example\\example.exe\" ' + '\"' + imgPath + '\"'; var myshell = new ActiveXObject( "WScript.shell" ); myshell.run( path, 1, true ); } </SCRIPT> <!-------------------------------------------------------------------> <a href="javascript:PROCTest('C:\\5H3QM0AC')">Launch the executable</a> Thanks!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now