[英]How to run all files including subdirectory with php.exe
I am try to use a bat file to run all php files on a folder and its directory. 我尝试使用bat文件在文件夹及其目录上运行所有php文件。
my files and directory look like this 我的文件和目录如下所示
file1.php
directory/file4.php
directory/subdirectory/file6.php
I want run these all files with php-cgi.exe as show in below my batch code but its not working 我想用php-cgi.exe运行所有这些文件,如下面的批处理代码所示,但它不起作用
set /P C= >NUL
move c:\currentfilefolder\* movetothisfolder\ >NUL
FOR %%i IN (folder1\*) DO (
php-cgi.exe -c php53.ini %%i > completefolder\%%~nxi
)
Can anyone help me with that. 谁能帮助我。
use forfiles
for this, and start in topmost folder 为此使用forfiles
,并从最顶层的文件夹开始
forfiles /S /M *.php /C "cmd /c php-cgi.exe -c php53.ini @file"
don't know about -i
switch, but you may need to provide full path for this. 不了解-i
开关,但是您可能需要为此提供完整路径。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.