【问题标题】:Open MyComputer using PHP COM class使用 PHP COM 类打开 MyComputer
【发布时间】:2015-10-28 12:14:01
【问题描述】:

我正在尝试使用 COM 类打开 MyComputer ...您能帮我解决 COM 类中 MyComputer 的名称吗? 例如,如果你想打开记事本,你可以这样做:

<?php
$shell = new COM("WScript.Shell");
$shell->Run("notepad.exe");
$shell = null; ?>

运行("notepad.exe");适用于记事本,但是当我使用 Run("mycomputer.exe"); 我遇到错误:

致命错误:E:\Localhost\root\test.php 中带有消息“来源:未知
描述:未知”的未捕获异常“com_exception”: 3 堆栈跟踪:#0 E:\Localhost\root\test.php(3): com->Run('computer.exe') #1 {main} 在 E:\Localhost\root\test.php 中抛出在线3

感谢您的帮助,亲爱的朋友

【问题讨论】:

  • 我的电脑不是程序,因此您需要寻找 Explorer.exe(Windows 文件浏览器)
  • tnx 伙计,它有效......但它打开了库!我想打开列出驱动器的 MyComputer 的主要部分。
  • 不确定是否可以传入参数,但这可能会对您有所帮助support.microsoft.com/en-us/kb/314853

标签: php com


【解决方案1】:

你可以试试:

<?php
$shell = new COM("WScript.Shell");
$shell->Run("explorer.exe ,");
$shell = null; ?>

当我们添加“,”时,它会打开我的电脑。

【讨论】:

    猜你喜欢
    • 2011-05-31
    • 1970-01-01
    • 1970-01-01
    • 2011-04-06
    • 2011-08-20
    • 1970-01-01
    • 2012-01-26
    • 2013-12-10
    • 2012-07-27
    相关资源
    最近更新 更多