Slipstick Forums  

Go Back   Slipstick Forums > Outlook Programming > Programming VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-28-2009, 11:55 AM
nbrege
Guest
 
Posts: n/a
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...

Reply With Quote
  #2  
Old 10-29-2009, 01:21 AM
MarceepooNu
Guest
 
Posts: n/a
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...
>

Reply With Quote
  #3  
Old 10-29-2009, 01:32 AM
MarceepooNu
Guest
 
Posts: n/a
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...
>

Reply With Quote
  #4  
Old 11-03-2009, 05:41 PM
Dan Mitchell
Guest
 
Posts: n/a
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

Reply With Quote
Reply

Bookmarks


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
can't send message w/html attachments Caruso Outlook General 0 10-05-2009 07:09 PM
Executable but not downloadable file KSnow Miscellaneous 1 07-28-2009 10:33 AM
No message and never received a message are sent in HTML, always in plain text Paul Falardeau Outlook General 3 06-05-2009 09:40 AM
Outlook: save HTML message into a single HTML file? Mr. Burns New Users 1 06-01-2009 09:43 AM
rules and HTML in message body Mickey Ferguson Outlook General 3 04-16-2009 03:47 PM


All times are GMT -4. The time now is 07:09 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.