dongzhuo1958 2014-03-25 14:32
浏览 56
已采纳

如何转换运行php的批处理文件行在VBS脚本中执行相同操作

I have a batch file that runs a PHP script on a windows system.

php C:\php\after.php

I am looking to include this within a VBS. I am aware that I could run the existing batch file from the VBS but is there a way to make it run from within the VBS natively?

  • 写回答

2条回答 默认 最新

  • doutangshuan6473 2014-03-25 15:04
    关注

    No, unfortunately there is no way to include the sub-commands off of the php framework into the vbscript environment. Even Visual studio which has access to all references and COM objects on the unit cannot access the PHP library.

    However, Visual studio can work with PHP Tools which by extension can be utilized in Visual Studio. I apologize that that is the capacity of including PHP in other coding environments. -> Here

    If you are just trying to convert the batch file to run from vbscript(even though it seems you have already researched this), view below.

    You can achieve this with the Wscript.wshshell.run command, which can run practically any batch file commands as long as they are in the correct directory.

    "Provides access to the native Windows shell." ~ Microsoft

    e.g.

    dim WshShell
    Set WshShell = WScript.CreateObject("WScript.Shell")
    WshShell.Run "php C:\php\after.php"
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 有没有帮写代码做实验仿真的
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥30 vmware exsi重置后登不上
  • ¥15 易盾点选的cb参数怎么解啊
  • ¥15 MATLAB运行显示错误,如何解决?
  • ¥15 c++头文件不能识别CDialog
  • ¥15 Excel发现不可读取的内容
  • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
  • ¥20 yolov5自定义Prune报错,如何解决?