homer.favenir Posted June 29, 2009 Share Posted June 29, 2009 hi to all, i have batch file: @echo off echo Hello this is a test batch file pause and its running well what i want is to run this thru php, because i dont want user directly running it. <?php set_time_limit(0); echo exec('C:\\commonfolder\\test.bat'); echo "Done!"; ?> it returned: Press any key to continue . . .Done! and there is no cmd window or no dos window. how can i make the cmd window open when php runs. thanks Link to comment https://forums.phpfreaks.com/topic/164033-try-to-execute-batch-file/ Share on other sites More sharing options...
trq Posted June 29, 2009 Share Posted June 29, 2009 how can i make the cmd window open when php runs. You would need to grant your server the appropriate permissions and then execute your script via cmd.exe. echo exec('cmd.exe C:\\commonfolder\\test.bat'); Link to comment https://forums.phpfreaks.com/topic/164033-try-to-execute-batch-file/#findComment-865475 Share on other sites More sharing options...
homer.favenir Posted June 29, 2009 Author Share Posted June 29, 2009 thanks for the reply but it didnt work. nothing happens. my php app is in my localhost Link to comment https://forums.phpfreaks.com/topic/164033-try-to-execute-batch-file/#findComment-865491 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.