starting an external program Tue, 11 November 2003 00:12

I'am using een php script with de exec() command to start een
external program that executes a ping-command and printcommand that prints
two lines on a printer.
The program itself works just fine, but used in a php-script
nothing happened.
I use this scriptline.

exec('c:\apache2\homepage\test.bat');
but nothing happen's

I use PHP 4.3 and Apache 2.0 and WinXP pro

test.bat is a batch-file that writes a logfile of a ping to the
temp dirictory.
Since de file test.bat is in de home directory of apache I even
don't have to use the path direction as in the original example. So changing
the backslash by a dubble one makes no difference
the test.bat file contains

ping 213.84.188.39 >c:\temp\test.log

The program "test.bat" is in de homedir from Apache
so the scriptline exec('c:\apache2\homepage\test.bat); or
exec("test.bat"); works fine

But adding a extra programline in de test.bat file that starts
the prnfrm.exe file,which is in the same directory will write a logfile but
doesn't print anything and that is what the prnfrm.exe file is supposed to
do. PhP is not in safe mode. and
according the manual no special operators have to be set.

the purpose of this all is to make a remote controll for a
webcam on a webpage. The control of the webcam is done with a visual basic
program. Before I build the hardware I want to be able to control the visual
basic program from a PHP scriptline. So I compiled a little VB program that
prints 2 lines on a printer, the prnfrm.exe file.

what's wrong

Han Leloux