Hi. I have a batch file which looks like
php a
php b
php c
php refers to a batch file in the php directory that looks like this:
ECHO OFF
IF NOT EXIST %1.php goto usage
php-cgi.exe -q %1.php
goto end
:usage
echo ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
echo ³ USAGE ³
echo ³Type "php.bat" (without quotes)³
echo ³ followed by the name of a ³
echo ³valid php file without the .php³
echo ³extension. ³
echo ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
:end
a b and c are .php files, but only a is executed.
Regardless of what the php code is, each file should be run, one after the other, but they dont.
Does anyone know whats going on?
This is so I can automate routine tasks on a win2k server.
Thanks for your time,
kinnon.
PHP on the command line and batch files
Moderator: General Moderators
feyd wrote:Maybe php.exe is interfering?
Windows tends to go for bat files first if no extension is defined, however, worth a try.
Modified the batch file to contain
php.bat a
php.bat b
php.bat c
so there would be no uncertainty. still the same result im afraid.
Thanks for the suggestion ... or have I misunderstood you?
kinnon
AHA. your right!! its sorted. You have just saved me a lot of hassle.feyd wrote:Hang on a second, you have two batch files?
If you run another batch file without a special command, the current batch file terminates. If memory serves it's the "call" command, as-in "call php.bat a" or something similar.
Without the call command, the execution does not get passed back to the origional batch file, so the other lines dont get run.
Thank you.