开发者

Scheduling PHP script with arguments with Schtasks

开发者 https://www.devze.com 2023-04-10 08:49 出处:网络
Just like the title says here is a sample of the command that I\'m trying to execute in windows command line:

Just like the title says here is a sample of the command that I'm trying to execute in windows command line:

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

I get a 'SUCCESS' response and I can see the task is scheduled, but when it runs I don't think php is able to locate the script file because the arg1 isn't being parsed from the file path/name. 开发者_如何学JAVA The task is removed from windows' Scheduled Tasks.


I got it sorted - I needed to remove the \"'s from the /tr ie:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消