windows - PHP not waiting for VB script to complete -
trying write php page has form lets type in remote ip or hostname, , retrieve basic info ram size , hd size.
the code processess form data:
$host = $_post['host']; $cmd = "cscript /nologo remotehostinfo.vbs ".$host; $output = shell_exec($cmd); echo "<pre>$output</pre>";
this remotehostinfo.vbs code, script wmi query remote host.
class="lang-vb prettyprint-override">dim arg set arg = wscript.arguments strcomputer = arg(0) on error resume next wscript.echo "info" wscript.echo "------" '//////// ram amount set objwmiservice = getobject("winmgmts:\\" & strcomputer & "\root\cimv2") set colcsitems = objwmiservice.execquery("select * win32_computersystem") each objcsitem in colcsitems ram = int(objcsitem.totalphysicalmemory/ 1048576) next wscript.echo "ram size: " & ram wscript.quit
when run script php page, not homecoming ram size, if run vb script command prompt works fine, know i'm doing wrong? can php not run vbscript query of remote host?
php windows shell vbscript wmi
No comments:
Post a Comment