PHP on the command line and batch files
Posted: Wed Jan 24, 2007 9:45 am
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 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.