Page 1 of 1

PHP on the command line and batch files

Posted: Wed Jan 24, 2007 9:38 am
by kinnon
Hi folks.

PHP is great for automating database tasks. I've written a set of php programs to manage various tasks, and a simple batch file scheduled to execute some of them one after another.
The batch file seems to only run the first command, then dosn't bother with the others in the batch file. This is frustrating as it meand I have to go in and run them manually from a command prompt.

The batch file looks like this,

php dothis

php dothat

php dothenextthing

'php' referrs to my php batch file in the php directory which 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

The OS is win2k server.

Can anyone help as this is really annoying me.

Thanks and all the best,
kinnon