views:

15

answers:

2

I have a batch file that displays a list of registry keys.

10000 20000 30000 40000 ..etc.

Using PHP, I can display the output of the batch file:

echo exec('file.bat');

This only shows me 40000 though, not the other three entries. How can I see everything?

+2  A: 

Use shell_exec() instead.

Ignacio Vazquez-Abrams
Perfect. Thanks!
ThisIsMyUsername
+1  A: 

exec() returns the last line from STDOUT. You can pass a second parameter to capture all of the STDOUT.

exec($command, $output = array());

Then all of the output text will be in $output.

pferate