这段代码为什么没执行?解决方法

WBOY
Release: 2016-06-13 10:17:50
Original
927 people have browsed it

这段代码为什么没执行?
通过PHP调用vbs脚本 启动迅雷下载软件. 单独运行vbs迅雷可以下载 PHP调用 没反应?
php代码如下:
define('ROOT', dirname(__FILE__).'/');
define('vbs', ROOT.'cmccapp_down.vbs');
$rs = array();
$file = 'http://www.baidu.com/img/baidu_sylogo1.gif';
if(!is_file($file)){
$name = basename($file);
$rs = array($file, $name, 'http://www.cmccapp.com/');
$content = file_get_contents(vbs);
preg_match_all('#\"([^"]+)\",#', $content, $m);
foreach($m[1] as $key=>$val){
$content = str_replace($val, $rs[$key], $content);
}
file_put_contents(vbs, $content);
$WshShell = new COM("WScript.Shell");

$cmdline = "cmd /C ".vbs;
$oExec = $WshShell -> Run($cmdline, 0, false);?
}
?>


vbs代码如下:

Set ThunderAgent = CreateObject("ThunderAgent.Agent.1")?
Call ThunderAgent.AddTask("http://www.baidu.com/img/baidu_sylogo1.gif","baidu_sylogo1.gif","","","http://www.cmccapp.com/",1,0,5)?
Call ThunderAgent.CommitTasks2(1)?
Set ThunderAgent = Nothing

------解决方案--------------------
PHP调用COM组件超级不稳定,放弃吧

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn