这段代码为什么没执行?解决方法
这段代码为什么没执行?
通过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组件超级不稳定,放弃吧

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



If you want to open vbs after closing it before, you can also open it. We can use the command code to open it. Let's take a look at how to open vbs. It is actually very simple. How to open win11vbs: 1. First, we click on the “Start Menu”. 2. Then click "Windows Terminal". 3. Then enter "bcdedit/sethypervisorlaunchtypeauto". 4. Then restart the computer, open the start menu, and search for "system information" in the search bar. 5. Then check whether "virtualization-based security" is turned on.

vbs is the abbreviation of Virtual-BasedSecurity, which is a security function based on virtualization. However, in Windows 11 systems, it is turned off by default. For users who need to use this feature, they may not know how to enable it. Fortunately, we can enable it via Windows Terminal (as administrator). For the convenience of users, we will share detailed steps in today’s Win11 tutorial. If you need more information, please visit our website. Tutorial on restarting vbs in win11 1. First, we right-click the start menu on the left side of the taskbar. 3. Then enter bcdedit/sethypervisorlaun

Use Java's File.length() function to get the size of a file. File size is a very common requirement when dealing with file operations. Java provides a very convenient way to get the size of a file, that is, using the length() method of the File class. . This article will introduce how to use this method to get the size of a file and give corresponding code examples. First, we need to create a File object to represent the file we want to get the size of. Here is how to create a File object: Filef

To learn more about open source, please visit: 51CTO Hongmeng Developer Community https://ost.51cto.com Running environment DAYU200:4.0.10.16SDK: 4.0.10.15IDE: 4.0.600 1. To create an application, click File- >newFile->CreateProgect. Select template: [OpenHarmony] EmptyAbility: Fill in the project name, shici, application package name com.nut.shici, and application storage location XXX (no Chinese, special characters, or spaces). CompileSDK10, Model: Stage. Device

How to convert php blob to file: 1. Create a php sample file; 2. Through "function blobToFile(blob) {return new File([blob], 'screenshot.png', { type: 'image/jpeg' })} ” method can be used to convert Blob to File.

Use Java's File.renameTo() function to rename files. In Java programming, we often need to rename files. Java provides the File class to handle file operations, and its renameTo() function can easily rename files. This article will introduce how to use Java's File.renameTo() function to rename files and provide corresponding code examples. The File.renameTo() function is a method of the File class.

Windows 11 VBS Tutorial: How to gracefully close applications? When using the Windows 11 operating system daily, we often encounter situations where we need to close multiple applications at the same time. Sometimes we may habitually click the close button, or use the task manager to end application processes one by one. However, using VBS script (VisualBasicScript) can more efficiently close multiple applications at once, making the operation smoother and more convenient. 1.What is

Windows Script Host provides users with an environment for executing scripts. Some scripts execute as soon as you log into your computer, and others may execute when you trigger them. When you log into your computer and then find an error saying "The system cannot find the file specified" error, this article will help you troubleshoot the problem. Well, the reasons for this problem can be different like malware attack or improper installation or some files have been deleted etc. Here we have different solutions that you can try and solve your problem, so let's get started! Method 1 – Download the autorun utility and check vbs entries Step 1 – Go to this website and click on the download icon in the upper right corner and save Step 2 – After downloading the folder
