note 74377 rejected from function.shell-exec by nlopess
| From: | nlopess@php.net | Date: | Sun, 08 Apr 2007 18:17:24 +0000 |
| Subject: | note 74377 rejected from function.shell-exec by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-125223@lists.php.net to get a copy of this message | ||
Note Submitter: d-skyman at gmx dot de
----
Hey RayJ,
I saw your way of executing a script by creating an Object of Wsript.shell . Now, is there a way of
outputting whatever the executed program outputs?
As an example:
<?php
$runCommand = "C:\\WINDOWS\\system32\\shutdown.exe -t:30"; //This is a false command, so
that the correct form of using shutdown.exe is outputted.
$WshShell = new COM("WScript.Shell");
$output = $WshShell->Run($runCommand, 7, true); //Because this is set true, the script waits for
the command to be executed.
echo "<p>$output</p>";
?>
This script still outputs "0" although I set the parameter "waitForOutput" to
true.
Is there any way someone knows how to get what the program answers?