Results 1 to 4 of 4

Thread: Run an executable with arguments from an HTML mail message

  1. #1
    nbrege Guest

    Default Run an executable with arguments from an HTML mail message

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


  2. #2
    MarceepooNu Guest

    Default RE: Run an executable with arguments from an HTML mail message

    I am very ignorant when it comes to HTML, but I think I see where your
    problem is.
    Here's some coding, which includes an ampersand to join two strings, and
    therefor probably isn't proper in an HTML context, but the following might
    give you an idea that you could code properly in HTML:

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

    Sorry if I wasted your time.

    MarceepooNu
    --
    MarceepooNu


    "nbrege" wrote:

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


  3. #3
    MarceepooNu Guest

    Default RE: Run an executable with arguments from an HTML mail message

    I'm very ignorant when it comes to HTML, but I think I see the vbscript
    problem. If I'm right, it has to do with the spaces in the path.

    I think HTML doesn't use the amperand (&) to join two strings; so the
    following code probably won't work; but I bet you'll know how to correct my
    error. So, here's my [wrong] code:

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

    I apologize if this wasn't helpful, and instead a waste of your time.


    --
    MarceepooNu


    "nbrege" wrote:

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


  4. #4
    Dan Mitchell Guest

    Default Re: Run an executable with arguments from an HTML mail message

    nbrege <nbrege@discussions.microsoft.com> wrote in
    news:C14FB3AD-923E-4D68-B4A7-634BC94C47AC@microsoft.com:
    > 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.


    There's no way to do this, URLs can't contain command-line arguments.
    Outlook doesn't matter here, it's just not possible.

    Here's some alternative approaches, assuming you control the server
    that it's being downloaded from, and the code that's being run:

    1. Request is "dostuff.exe?order=1234"; the server 302 redirects to
    "dostuff_order_1234.exe", and dostuff.exe checks its own filename and
    pulls command-line arguments out of there

    2. Server drops a cookie with "order=1234" when it gets the request;
    dostuff.exe reads cookies back out when it starts (this is probably
    impossible on newer versions of Firefox, they changed the cookie code so
    this is much more difficult than it used to be)

    3. append bytes with the arguments to the executable, executable reads
    its own binary at launch time. Works fine, but breaks code signing.

    4. server downloads a zip file with a batch file in there, user runs
    the batch file, batch file contains "dostuff order=1234"

    5. define new file extension, '.dostuff'; user downloads a .dostuff
    file containing "order=1234", associate .dostuff with your executable.


    -- dan


Similar Threads

  1. Can I embed a clickable link that includes command line arguments?
    By Clif McIrvin in forum New Users Archive
    Replies: 10
    Last Post: 11-25-2009, 05:24 AM
  2. Mail Merge Prompt for each mail and HTML problem
    By Tobey in forum Outloook General Archives
    Replies: 1
    Last Post: 11-11-2009, 05:44 AM
  3. Executable but not downloadable file
    By KSnow in forum Exchange Miscellaneous Archive
    Replies: 1
    Last Post: 07-28-2009, 06:33 AM
  4. No message and never received a message are sent in HTML, always in plain text
    By Paul Falardeau in forum Outloook General Archives
    Replies: 3
    Last Post: 06-05-2009, 05:40 AM
  5. Outlook: save HTML message into a single HTML file?
    By Mr. Burns in forum New Users Archive
    Replies: 1
    Last Post: 06-01-2009, 05:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts