-1

Can anyone tell me how to execute a .exec file from a PHP script in a client system?

I have tried:

<?php
$answer = shell_exec("C:\Users\hp\Desktop\DotNet7.exe");
echo $answer."</br>";
?>

Nothing is working. It works on localhost but fails online. I need help

  • 4
    You know the PHP is executed server-side, right? It will only access files on the same server. I doubt this filepath is correct. – Zenoo Apr 09 '18 at 14:09
  • This is fundamentally not possible. – Alex K. Apr 09 '18 at 14:11
  • @RaymondNijland - the user is asking how to execute that on the _client system_ -- I think that's why AlexK states it is not possible. – Alexander Nied Apr 09 '18 at 14:13
  • never mind @AlexK.and Alexander Nied didn't read the question proberly that's why i've deleted the comment.. Ofcourse a server can't force the client to start up the program.. – Raymond Nijland Apr 09 '18 at 14:14

1 Answers1

0

You need to try do it with JavaScript functions.

checkout this please

Is it possible to run an .exe or .bat file on 'onclick' in HTML

Davit Huroyan
  • 302
  • 4
  • 16
  • Having some javascript run local executables sounds like a recipe for disaster. And I doubt it's possible. – Progrock Apr 09 '18 at 14:39
  • I run the exe with js(will double check again) but if the application is own like Zoom you can try to write in registery a url protocol and call your application with this protocol https://stackoverflow.com/questions/389204/how-do-i-create-my-own-url-protocol-e-g-so – Davit Huroyan Apr 10 '18 at 06:17