Plan a task that will execute a batch file.

Posted on 2006-05-26
Last Modified: 2010-04-18
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.
Question by:bruno_boccara
    LVL 95

    Assisted Solution

    by:Lee W, MVP
    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.
    LVL 9

    Accepted Solution

    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"


    Author Comment

    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.

    LVL 11

    Expert Comment

    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
    LVL 32

    Assisted Solution

    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:

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    A quick step-by-step overview of installing and configuring Carbonite Server Backup.
    Learn about cloud computing and its benefits for small business owners.
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now