homer.favenir Posted July 9, 2009 Share Posted July 9, 2009 hi, anyone knows how can i run a batch file from php and pass a parameter to that batch file. the approach is in the php the user will input the parameter, browse the batch file and submit. the batch file will open in cmd, with the parameter passes to it from php. after the batch file close, the php will ask a conditional question... i cant make the exec() or system() working anyone please. thanks Link to comment https://forums.phpfreaks.com/topic/165292-run-batch-file-from-php/ Share on other sites More sharing options...
shergold Posted July 9, 2009 Share Posted July 9, 2009 you can use backticks to execute a command and open and start a batch file in php like so: echo `start C:\folder\file.bat`; If you need anymore help just ask and ill try, Shergold. Link to comment https://forums.phpfreaks.com/topic/165292-run-batch-file-from-php/#findComment-871684 Share on other sites More sharing options...
homer.favenir Posted July 9, 2009 Author Share Posted July 9, 2009 nope, it didnt work... ( Link to comment https://forums.phpfreaks.com/topic/165292-run-batch-file-from-php/#findComment-871710 Share on other sites More sharing options...
cunoodle2 Posted July 9, 2009 Share Posted July 9, 2009 did you check the error on line 37? Link to comment https://forums.phpfreaks.com/topic/165292-run-batch-file-from-php/#findComment-871751 Share on other sites More sharing options...
homer.favenir Posted July 9, 2009 Author Share Posted July 9, 2009 line 37? theres no error, only the page keep on loading again and again, but the batch file didnt executed Link to comment https://forums.phpfreaks.com/topic/165292-run-batch-file-from-php/#findComment-871755 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.