Help with Passthru and wmic...

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm trying to get this to work..

echo passthru('wmic cpu get loadpercentage');

and just output to the browser...  It looks like cmd.exe hangs when it
tries to execute the command.  The IUSR_ account has access to both the
cmd.exe and wmic files.  I have also tried copying the wmic files to
the C:\php dir, and to the directory the web app is running from.  Any


Re: Help with Passthru and wmic... wrote:
Quoted text here. Click to load it

You will have to use proc_open to start a process in read/write mode;  

$descriptorspec = array(

$process = proc_open("wmic", $descriptorspec, $pipes);
fwrite($pipes[0], 'cpu get loadpercentage');

print stream_get_contents($pipes[1]);


Site Timeline