PDA

View Full Version : Run an executable with arguments from an HTML mail message


nbrege
10-27-2009, 07:37 PM
I want one of my applications to send an HTML email message to a user with a hyper link in it to start up an executable with arguments passed to it. It works fine if I just specify the executable path with no arguments. But if I pass the arguments then Outlook says it can't find the file.

Here is the line that I add to the email message body to start the exe only:

"<a href="""C:\program files\someFolder\myApp.exe""">Click here</a> to run program."

but if I add the arguments it doesn't work:

"<a href="""C:\program files\someFolder\myApp.exe cust=1234 order=5678""">Click here</a> to run program."

Has anyone done this before or know what I need to do to make it work with arguments? Thanks...

Spookster
10-27-2009, 10:58 PM
Putting spaces in the HREF attribute would be your problem.

You would probably need to use a bit of scripting to accomplish this and even then there are many assumptions that would need to be made as well as other obstacles would surface as launching an executable from a webpage or HTML based email will likely get flagged by various antivirus, spyware or other security software applications.

There are a few other threads on this topic such as this one:
http://www.codingforums.com/showthread.php?threadid=5657