开发者

How to Pass Parameters to a client executable in a link

开发者 https://www.devze.com 2023-01-30 15:49 出处:网络
If I have a link in my page of the form: <A HREF=\"/executable.exe?param=1\">Run</A> Are the parameters after the \"?\" passed to the executable after the browser has downloaded the exe

If I have a link in my page of the form:

<A HREF="/executable.exe?param=1">Run</A>

Are the parameters after the "?" passed to the executable after the browser has downloaded the executable, and the user 开发者_C百科has chosen to run the executable?

I have examined argv, and the environment, but doesn't seem to be there.

Is there any other place where the browser might be passing the parameters to the executable?


The parameters are just part of the url request.

What is done server side with it is completely up to you.

But if you expect the client to execute the file with those params, it will not work.

  1. The file won't be executed at all but only downloaded, and that probably with a warning (in modern systems)

  2. Once the file is Downloaded and the client executes it, it is just up the the client how he executes it. Nothing to do with your params any more

  3. There is however a hack in early versions of internet explorer 5 or even 6 but I won't talk about that here because it has no relevancy any more and is only an harmful expoit.


Link it to .cmd or a bat file which has the command to execute executable.exe with parameters.

So, your link should lookl ike

<a href ="/someth.cmd> Run me </a>

and the .cmd file should contain

executable.exe param1 param2 

Hope it helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消