[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

Plan a task that will execute a batch file.

Hi,
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.
Thanks.
0
bruno_boccara
Asked:
bruno_boccara
3 Solutions
 
Lee W, MVPTechnology 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.
0
 
imnajamCommented:
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"

Cheers!
0
 
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.


0
 
star_trekCommented:
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
0
 
r-kCommented:
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:

 http://www.experts-exchange.com/Operating_Systems/Windows_Server_2003/Q_21862784.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now