maxwel11 Posted June 9, 2015 Share Posted June 9, 2015 (edited) exec, system, shell_exec not working for me... my php is just made to execute/run a batch file. i have tried everything some dont give any echo back and some like system("cmd /c batch file") and echo exec("batch file") and echo shell_exec("batchfile") echo the content in the batch file with cmd directory like this. C:\dir\dir>start /d "C:\Program Files (x86)\dir\dir" programname.exe... batch file contain this "start /d "C:\Program Files (x86)\dir\dir" programname.exe"......i tried to add @echo off at the begining maybe this make it run the batch but no effect beside not echoing what in the batch file like explained before. also check if apache got admin permission and it does have admin perm. i tried everything cmd.exe removing cmd /c etcc but with no use also wanted to inform that batch file works when i launch it manually (double clicking it) and it launch the program but i want the php script to do so.. is it possible?Thanks alot and would appreciate any help.. Edited June 9, 2015 by maxwel11 Quote Link to comment https://forums.phpfreaks.com/topic/296725-exec-system-shell_exec-not-working/ Share on other sites More sharing options...
requinix Posted June 9, 2015 Share Posted June 9, 2015 You're using PHP to run a batch file to run an application? Post code. Quote Link to comment https://forums.phpfreaks.com/topic/296725-exec-system-shell_exec-not-working/#findComment-1513554 Share on other sites More sharing options...
maxwel11 Posted June 9, 2015 Author Share Posted June 9, 2015 yes . i tried to do it directly from php to run the program itself but didntt work at all too Quote Link to comment https://forums.phpfreaks.com/topic/296725-exec-system-shell_exec-not-working/#findComment-1513557 Share on other sites More sharing options...
maxwel11 Posted June 10, 2015 Author Share Posted June 10, 2015 there is no code cuz i am just like testing thats how the code looks like: system ("batforsam.bat");..i just simply wantt to run a software with bat file.. any idea? Quote Link to comment https://forums.phpfreaks.com/topic/296725-exec-system-shell_exec-not-working/#findComment-1513584 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.