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!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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:


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

    Run MyEXE

    %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

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