note 74377 added to function.shell-exec

From: Date: Sun, 08 Apr 2007 17:21:09 +0000
Subject: note 74377 added to function.shell-exec
Groups: php.notes 
Request: Send a blank email to php-notes+get-125221@lists.php.net to get a copy of this message
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? ---- Server IP: 212.124.37.9 Probable Submitter: 62.104.186.210 ---- Manual Page -- http://www.php.net/manual/en/function.shell-exec.php Edit -- https://master.php.net/note/edit/74377 Del: integrated -- https://master.php.net/note/delete/74377/integrated Del: useless -- https://master.php.net/note/delete/74377/useless Del: bad code -- https://master.php.net/note/delete/74377/bad+code Del: spam -- https://master.php.net/note/delete/74377/spam Del: non-english -- https://master.php.net/note/delete/74377/non-english Del: in docs -- https://master.php.net/note/delete/74377/in+docs Del: other reasons-- https://master.php.net/note/delete/74377 Reject -- https://master.php.net/note/reject/74377 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#125221) next »