Reputation: 102
I want to write a php code to automate the below mentioned process.
Process in Windows Command prompt for each file:
run-all.bat RelativePath+filename.php
I have around thousand's of files and if I do it manually then it will take a while. I took folder path input from the user, then accessed each file.
To execute the command, used exec
function of php, but don't know how to specify "cd folder path and run-all.bat" in a single line, as if we are not inside the specific folder "x" the command run-all will not be executed.
For the third step, I think the somehow array output (second parameter can be used).
Any help/suggestion are appreciated as I'm a newbie to php?
Upvotes: 2
Views: 136
Reputation: 721
guess this is what you are looking to accomplish ?
exec ('c:\\somefolder\\run-all.bat RelativePath\\filename.php', $output);
Upvotes: 2