zohab Posted November 17, 2006 Share Posted November 17, 2006 HiI my application i need excute command from command linelikec:\\test>test.exe can we excute .exe using php script.I read exec() and system() but i am not able to get it.If yes ,can i get simple example. Best regardszohab. Link to comment https://forums.phpfreaks.com/topic/27582-how-to-excute-exe-using-php/ Share on other sites More sharing options...
Humpty Posted November 17, 2006 Share Posted November 17, 2006 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'tThis 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 Link to comment https://forums.phpfreaks.com/topic/27582-how-to-excute-exe-using-php/#findComment-126141 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.