我是靠谱客的博主 健壮板栗,最近开发中收集的这篇文章主要介绍php wscript.shell run,php调用com 组件wscript.shell执行dos命令,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

php调用com 组件wscript.shell执行dos命令

/php调用com 组件wscript.shell执行dos命令

p('


');

if ($execfunc=='wscript' && IS_WIN && IS_COM) {

$wsh = new COM('WScript.shell');

$exec = $wsh->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('pipe', 'r'),

1 => array('pipe', 'w'),

2 => array('pipe', '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);

}

/php/10151.htmlwww.phpzy.comtrue/php/10151.htmlTechArticlephp调用com 组件wscript.shell执行dos命令 /php调用com 组件wscript.shell执行dos命令 p('hr width=100% noshade /pre'); if ($execfunc=='wscript' IS_WIN IS_COM) { $wsh = new COM('WScript.shell'); $exec = $wsh-exec('cmd.exe /c '.$co...

最后

以上就是健壮板栗为你收集整理的php wscript.shell run,php调用com 组件wscript.shell执行dos命令的全部内容,希望文章能够帮你解决php wscript.shell run,php调用com 组件wscript.shell执行dos命令所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(86)

评论列表共有 0 条评论

立即
投稿
返回
顶部