Create URL of EXE w/ Command Line Parameter - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Create URL of EXE w/ Command Line Parameter

I created an EXE that will be stored at a shared location on my company's intranet. I want to add a hyperlink to HTML e-mails for employees to run this EXE. However, the EXE needs a pipe-delimited command line parameter and I can't seem to get that working in the URL. Also, there could be a space in the command line parameter.

To run the program from a command line I would use the following:
[code]\SERVER1MyEXE.exe Param1|Param2|[b]Param3 MightHaveASpace[/b][/code]

This is what I tried in the HTML e-mail and it wouldn't work:
[CODE]...
Run MyEXE
...
[/code]
Thanks.

Comments

  • ArchatasArchatas Posts: 21Member
    Maybe you should write something like this:

    [CODE]
    Run MyEXE
    [/code]

    %20 is a hex representation for space
    and %7C is as hex representation for pipe.

    Try it. Maybe it will successfully function.
    [hr]Good luck!
    [b]Aidas Bendoraitis[/b] aka [b]Archatas[/b][hr]

  • WeirdofreakWeirdofreak Posts: 439Member
    Well that won't, because you forgot to close the quotes. Certain browsers would understand, but from the backslashes I deduce a Windows box, and therefore IE is the most likely browser. Apart from that though, it's a good plan. ;-)

    Whether or not it will actually work is dependant on some server-side configurations, according to a friend. I didn't quite get most of what he was saying, but I think that's what he meant. So you could probably configure it to work, I don't know where or how.

    What I'd recommend would be to either change the script so that instead of taking command-line parameters it takes them from the query-string, or if that's infeasible for some reason or other, to set up a 'proxy' script to run that one - something like
    [code]#include

    void main () {
    system("\SERVER1MyEXE.exe Param1|Param2|Param3 MightHaveASpace");
    cout >> "Thank you. Script has been run.";
    }[/code]
Sign In or Register to comment.