I tried piping, redirecting, etc. and no luck.
Here is the code:
Code: Select all
$output2=null;
$retvar=null;
echo "<h3>Check for running VMs</h3>";
$output2 = shell_exec("vboxmanage.exe list runningvms");
echo "<pre>$output2</pre>";I also tried:
a.
Code: Select all
$output2 = shell_exec("vboxmanage.exe list runningvms>runningvms.txt");b.
Code: Select all
$output2 = shell_exec("vboxmanage.exe list runningvms 2>&1");c.
Calling the version works
Code: Select all
$output2 = shell_exec("vboxmanage.exe --version");I don't know if this is STDOUT but I can't think of another way to capture the output of "list runningvms"
This is running on a Windows 7 with IIS 7. I cannot use Linux, I cannot use Apache and I cannot upgrade to Windows 10. If you find out that it works in other OSs it will make me jealous but it does not solve my problem so please focus on Windows 7 with IIS 7.
Let me know if there is another way to do this programmaticaly and send it to PHP. I could call Python and send to a text and read the text file in PHP. I will try this unless anyone here has a better way.
Thanks,