Jump to content

how to excute .exe using php


zohab

Recommended Posts

This is the best that I can help you with here:

There is 3 things you have to know about this first:
1) I am writting and testing my code on windows to be uploaded and used on linux.
2) I created .BAT files of the same name and stored them in the same directory as my test files in windows and they will ALWAYS output "PASS".
3) I use variables, but if you don't need to then don't

This is my command:
[code]            //Run the script / file
$TempVar = exec('FileToRun Variabe_1 Variable_2');
           
            //Check if there was an outputted error
if ($TempVar !="PASS"){
echo "THIS FAILED";
            }[/code]

Now that you have seen that you know that it happens, maybe your best bet would be to put the file in the same directory.

HOWEVER, if you want to execute a file on an end-users computer I don't think you can, only on the server.

....I may not have been much help but at least I tried :D

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.