duanchi19820419
2012-09-26 15:25
浏览 95
已采纳

32位PHP可以在64位IIS服务器上运行.vbs脚本吗?

There is a vbscript that we must run to consolidate information gathered in a custom web application into our management software. The .vbs is in the same folder as the web application which is built in CodeIgniter 2.

Here is the controller code:

public function saveToPM( $budgetType ){
    // run it 
    $obj = new COM( 'WScript.Shell' ); 

    if ( is_object ( $obj ) ) { 
        $obj->Run( 'cmd /C wscript.exe D:\pamtest\myload.vbs', 0, true );
        var_dump($obj->Run);
    } else { 
        echo 'can not create wshell object'; 
    } // end if

    $obj = null;

    //$this->load->view('goodPush');
} // end saveToPM function

We have enabled DCon in the php.ini file and used dcomcnfg to enable permissions for the user.

I borrowed the code from http://www.sitepoint.com/forums/showthread.php?505709-run-a-vbs-from-php.

The screen echos "Code executed" but the vbscript does not run.

We have been fighting with this for a while so any help is GREATLY appreciated.

图片转代码服务由CSDN问答提供 功能建议

我们必须运行一个vbscript,将自定义Web应用程序中收集的信息合并到我们的管理软件中。 .vbs与CodeIgniter 2中构建的Web应用程序位于同一文件夹中。

以下是控制器代码:

   public function saveToPM($ budgetType){
 //运行它
 $ obj = new COM('WScript.Shell');  
 
 if(is_object($ obj)){
 $ obj-> Run('cmd / C wscript.exe D:\ pamtest \ myload.vbs',0,true); 
 var_dump($ obj  - >运行); 
} else {
 echo'无法创建wshell对象';  
} //结束如果
 
 $ obj = null; 
 
 // $ this-> load-> view('goodPush'); 
} //结束saveToPM函数
   
 
 

我们在php.ini文件中启用了DCon,并使用dcomcnfg为用户启用了权限。

我借用了< a href =“http://www.sitepoint.com/forums/showthread.php?505709-run-a-vbs-from-php”rel =“nofollow”> http://www.sitepoint.com/forums/ showthread.php?505709-run-a-vbs-from-php 。

屏幕回显“代码已执行”但vbscript无法运行。 \ n

我们一直在争取这一点,所以任何帮助都非常感激。

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

相关推荐 更多相似问题