I want php file to run exe file and display the exe file content when user goes to a particular url. I am trying to run exe file using php function exec('abc.exe');. But I only see blank page. Anyone know how to solve it or how to run exe file from php file correctly? Many thanks in advance. asked Sep 3, 2012 at 16:52
To access the operating system with php you do the following
The $answer string will contain the information that the abc.exe prints out or returns. You may need to format it using explode(). answered Sep 3, 2012 at 16:54
1 You can only run exe files if your php is runnning on a Windows machine. Futhermore, if you are on shared hostig, your hoster may have disabled the exec command. If you are on a Windows machine, 'abc.exe' must be in the current directory or in the PATH. To capture the output use:
Link to exec answered Sep 3, 2012 at 16:55
JvdBergJvdBerg 21.6k8 gold badges35 silver badges54 bronze badges 3 You can use VaccinalBowl code in windows, but for address .exe file, see the following example :
Bioukh 1,7781 gold badge15 silver badges25 bronze badges answered Feb 5, 2016 at 9:40
I know this answer might be late but there is a "hack" in php you can use with Task Scheduler in Windows. The following code works and works with all browsers not just IE. However I should warn you that sometimes the program you are accessing may not run at that instant in time sometimes as I've noticed sometimes that the scheduled task may be in a "queued" state and not running. But the code does work 100%...it is just a matter of what state the task is in in task scheduler...either its "running" or "queued".
answered May 24, 2020 at 8:33
2 Encountered with permission problem even with 2&>1 (although chmod 777), but workaround by reading the output via saving into a file See the example, cs_crypto is something to decrypt
So the final result in web answered Jun 29, 2018 at 6:27
LinconFiveLinconFive 1,4521 gold badge17 silver badges24 bronze badges |