Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML hyperlink to call exe with parameters

Tags:

html

href

email

exe

-Hello, looking for some help.

We currently have a winform app used to do approvals in our company. The app sends html emails to the "approvers" who read the relevant info in the email and click on a hyperlink which launches the app so they can do their approval.

Currently this is done by including the following in the email html:

<a href=file:///C:\Temp\test.exe>Click to Approve</a>

This correctly launches the app, after a couple of security warnings which we are OK with. We use Outlook 2010.

Now, in order to improve this process I would need to pass an argument identifying the approver to the app. This works correctly if I pass the argument from, say, a windows shortcut, however, I cannot find a way to pass the argument to the exe in the href attribute in order to do it from the email. I looked everywhere, and found nothing except questions.

I have tried the following to no avail:

<a href=file:///C:\Temp\test.exe approverID>Click to Approve</a> <a href=file:///C:\Temp\test.exe 'approverID'>Click to Approve</a> <a href="file:///C:\Temp\test.exe approverID">Click to Approve</a>

Also I have tried doing it with JavaScript, which from an HTML page works fine, but not from an email in Outlook.

I thought maybe there is a security threat with this approach hence it is not possible, but if I can successfully from an email run an exe, why can I not run an exe with parameters? It doesnt make sense.

Thank you for your help.

Leo

like image 423
leoinlios Avatar asked Apr 03 '12 13:04

leoinlios


People also ask

How do you pass a parameter from one hyperlink to another?

Passing (Sending) Parameters using HyperLink in HTML. The HTML Anchor Link is assigned an OnClick event handler and when clicked, the value of the TextBox is set in the HREF attribute of the HTML Anchor Link using JavaScript. When the HTML Anchor Link is clicked, the TextBox value is passed to the other Page as QueryString parameter.

What is the syntax of hyperlink in HTML?

HTML Links - Syntax. The HTML <a> tag defines a hyperlink. It has the following syntax: <a href="url">link text</a>. The most important attribute of the <a> element is the href attribute, which indicates the link's destination. The link text is the part that will be visible to the reader. Clicking on the link text, ...

How to set the value of textbox in hyperlink using JavaScript?

The HTML HyperLink will be assigned an OnClick event handler and when clicked, the value of the TextBox will be set in the HREF attribute of the HTML HyperLink using JavaScript. When the HTML Anchor Link is clicked, the TextBox value will be passed to the other Page as QueryString parameter using JavaScript.

What is an HTML link?

HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand. Note: A link does not have to be text. A link can be an image or any other HTML element! The HTML <a> tag defines a hyperlink. It has the following syntax:


1 Answers

after not getting any suitable responses and after continuing my research for this without success, I will temporarily conclude that what I am looking for is not possible. If the reasons for this not being possible concern security, then I am completely puzzled as to why running an exe without parameters is allowed and therefore considered LESS harmful than running an exe with parameters. Surely, an exe does not require parameters to be harmful. If anyone would care to elaborate on this, it would be educational for me, thank you.

Nevertheless, I have thought of an alternative to my problem, which is not as elegant as would otherwise be stating parameters in href, but it serves my purpose. Because our app is run from a network drive, I have changed it so that it creates user-specific cmd files on the network drive and the hyperlink in the email it creates points to these cmd instead of the exe. That way, the cmd files contains the call to the exe with the correct parameters and as the cmd files are very light and quickly written, this is OK.

I am closing this as "answered", but it is not.

Thanks for taking your time to read.

Leo

like image 113
leoinlios Avatar answered Oct 22 '22 00:10

leoinlios