Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
565 views
in Technique[技术] by (71.8m points)

php - How to launch cmd.exe to execute command using Task Scheduler ?

I want to launch cmd.exe to execute command using Task Scheduler :

Here is my command line :

C:wampinphpphp5.5.12php.exe -f "C:Inetpubwwwrootphpindex.php"

This command will load a php.exe and run my php script from C:Inetpubwwwrootphp

Here is how I set up my task scheduler :

enter image description here

I am not sure - what to put in the Start in Box - plus since it's (optional) so I leave it blank.

After save the task and hit run, I got this

enter image description here

It doesn't do anything.

What did I do wrong - here ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Program should not be cmd but C:wampinphpphp5.5.12php.exe and the argument should be -f "C:Inetpubwwwrootphpindex.php". You can leave Start in blank. It refers to "current folder" from the program's perspective. It should not really matter in you current scenario.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...