我需要在每天午夜在我的服务器上运行一个php脚本。在Linux系统中,我会设置cron job,但现在我只能使用Windows系统。
我知道我需要使用Windows任务计划程序设置任务,并且该任务将需要运行一个.bat文件,而.bat文件将运行php文件,但我无法编写.bat文件。
目前我拥有的是:
@echo off
REM this command runs the nightly cron job
start "C:\Program Files (x86)\PHP\v5.3\php.exe" -f C:\inetpub\wwwroot\sitename\crons\reminder-email.php
但是当我尝试手动运行.bat文件进行测试时,我得到一个Windows警告,上面写着:
"Windows找不到“-f”。请确保你输入的名称正确,然后重试。
我错过了什么?