Kicking off a python script using Windows Scheduled Task

Discussion in 'Python' started by korean_dave, Oct 15, 2008.

  1. korean_dave

    korean_dave Guest

    Does anyone know how to properly kick off a script using Windows
    Scheduled Task? The script calls other python modules within itself.
    HERE'S THE CATCH:
    I am used to running the script directly from the command window and
    the print() is very handy for us to debug and monitor. When running
    the task from Windows Scheduled Task, we'd like to be able to view the
    command window and keep it up after the Task has completed...

    I used the commands

    CMD /K

    cd C:\testdirectory\script_RunTests

    python AutomatedTestRun.py

    but when AutomatedTestRun.py calls other python modules, we don't see
    output.
     
    korean_dave, Oct 15, 2008
    #1
    1. Advertising

  2. korean_dave

    korean_dave Guest

    Hey all. i solved this problem by logging on with my network domain
    login (log in using...)

    instead of NT AUTHORITY\SYSTEM which only gave out local privleges to
    the process started off by Task scheduler.

    On Oct 15, 10:36 am, korean_dave <> wrote:
    > Does anyone know how to properly kick off a script using Windows
    > Scheduled Task? The script calls other python modules within itself.
    > HERE'S THE CATCH:
    > I am used to running the script directly from the command window and
    > the print() is very handy for us to debug and monitor. When running
    > the task from Windows Scheduled Task, we'd like to be able to view the
    > command window and keep it up after the Task has completed...
    >
    > I used the commands
    >
    > CMD /K
    >
    > cd C:\testdirectory\script_RunTests
    >
    > python AutomatedTestRun.py
    >
    > but when AutomatedTestRun.py calls other python modules, we don't see
    > output.
     
    korean_dave, Oct 15, 2008
    #2
    1. Advertising

  3. In message
    <>,
    korean_dave wrote:

    > Does anyone know how to properly kick off a script using Windows
    > Scheduled Task? The script calls other python modules within itself.
    > HERE'S THE CATCH:
    > I am used to running the script directly from the command window and
    > the print() is very handy for us to debug and monitor. When running
    > the task from Windows Scheduled Task, we'd like to be able to view the
    > command window and keep it up after the Task has completed...


    Why not redirect stdout and stderr to a log file, and tail that?

    Another option might be screen <http://www.gnu.org/software/screen/>.
     
    Lawrence D'Oliveiro, Oct 19, 2008
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    2
    Views:
    377
    Andrew Thompson
    Feb 25, 2004
  2. Ian Walsh

    Scheduled Task in J2EE

    Ian Walsh, Sep 11, 2004, in forum: Java
    Replies:
    3
    Views:
    3,728
    Wei Jiang
    Sep 13, 2004
  3. cksanjose

    Scheduled task using timer

    cksanjose, Oct 31, 2007, in forum: Java
    Replies:
    2
    Views:
    337
    Piotr Kobzda
    Oct 31, 2007
  4. Alessandro
    Replies:
    1
    Views:
    1,828
    Arne Vajhøj
    Feb 5, 2009
  5. Simon
    Replies:
    8
    Views:
    142
    Simon
    Jul 4, 2007
Loading...

Share This Page