【问题标题】:Scheduling PHP script with arguments with Schtasks使用 Schtasks 使用参数调度 PHP 脚本
【发布时间】:2011-11-30 20:13:28
【问题描述】:

正如标题所说,这里是我尝试在 Windows 命令行中执行的命令示例:

Schtasks /create /tn "demo1" /tr "C:\xampp\php\php.exe \"c:\xampp\htdocs\testrunner\php\scheme_executor.php arg1\"" /ru Administrator /rp Pa55word! /sc once /st 08:56:00

我收到“成功”响应,我可以看到任务已安排,但是当它运行时,我认为 php 无法找到脚本文件,因为 arg1 没有从文件路径/名称中解析.该任务已从 Windows 的计划任务中删除。

【问题讨论】:

    标签: php windows scheduled-tasks parameter-passing


    【解决方案1】:

    我已经整理好了 - 我需要从 /tr 中删除 \":

    Schtasks /create /tn "demo1" /tr "C:\xampp\php\php.exe c:\xampp\htdocs\testrunner\php\scheme_executor.php arg1" /ru Administrator /rp Pa55word! /sc once /st 08:56:00
    

    【讨论】:

      猜你喜欢
      • 2017-05-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-20
      • 2011-09-16
      • 2017-04-23
      相关资源
      最近更新 更多