PHP:如何检查.exe是否已在运行? [英] PHP: How to check if a .exe is already running?

查看:57
本文介绍了PHP:如何检查.exe是否已在运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:



网页将方法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中处理这个问题。

解决方案

_POST [' 发起']))
{


shell = new COM( WScript.Shell die( 需要Windows Scripting Host) ;


exePath = TestDlg.exe;

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.

解决方案

_POST['Initiate'])) {


shell = new COM("WScript.Shell") or die("Requires Windows Scripting Host");


exePath = "TestDlg.exe";


这篇关于PHP:如何检查.exe是否已在运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆