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条)

报告相同问题?

悬赏问题

  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单
  • ¥15 神经网络怎么把隐含层变量融合到损失函数中?
  • ¥15 lingo18勾选global solver求解使用的算法
  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥20 测距传感器数据手册i2c