Plan a task that will execute a batch file.

I have a batch file with the following:
c:\php\php.exe  c:\scripts\myScript.php

what should be the syntax for making the file running by a task.
Who is Participating?
imnajamConnect With a Mentor Commented:
Hi leew,

a task can also be sheduled keeping it as it is in double quotes like "c:\php\php.exe  c:\scripts\myScript.php"

Lee W, MVPConnect With a Mentor Technology and Business Process AdvisorCommented:
I would just put that single line into a file ending in .bat or .cmd and then schedule that file to run in the task scheduler.
bruno_boccaraAuthor Commented:
In fact I made a .bat file, and the good syntax is:
"c:\php\php.exe"  "c:\scripts\myScript.php"

but this only works when running the .bat file mannualy (right clik on the file and execute, or in a prompt).

It DOESN'T work in a schedule task or when doing right click on the task then execute.

WHich user account are you using? may be the account that you set for the batch fie might not have perms to access all the resource. If you are not using an admin account then i suggest you to try using that
r-kConnect With a Mentor Commented:
Try to schedule with the AT or SCHTASKS command using the System account (the AT command does that bt default)

An example and more info is in this recent thread:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.