问题描述
场景:
网页将方法Initiate发布到server.php文件。 server.php文件将启动应用程序TestDlg.exe。
代码:
if (isset($ _ POST ['' 发起']))
{
$ shell = new COM( WScript.Shell)或 die( 需要Windows Scripting Host);
$ exePath = TestDlg.exe ;
$ shell-> exec($ exePath); // 这是成功启动应用程序
}
我需要什么:
每次发布Initiate时都会启动多个TestDlg.exe实例。而不是始终启动TestDlg.exe,有没有办法检查TestDlg.exe是否已经启动,然后启动,如果它没有启动?
****我无法编辑应用程序TestDlg.exe,我没有权利。所以请不要告诉我在应用程序本身中杀死TestDlg.exe的任何新实例。我想在php中处理这个问题。
Scenario:
A webpage posts a method "Initiate" to server.php file. The server.php file will launch the application "TestDlg.exe".
Code:
if (isset($_POST['Initiate'])) { $shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host"); $exePath = "TestDlg.exe"; $shell->exec($exePath); //this is launching the application successfully }
What i need:
Multiple instances of TestDlg.exe are launched each time i post "Initiate". Instead of launching "TestDlg.exe" always, is there any way to check if "TestDlg.exe" is already launched and then launch if it is not launched?
**** I cannot edit the application "TestDlg.exe", i do not have the rights. So please don't tell me to kill any new instances of the TestDlg.exe in the application itself. I want to handle this in php.
这篇关于PHP:如何检查.exe是否已在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!