Windows IT Pro is the leading independent community for IT professionals deploying Microsoft Windows server and client applications and technologies.
  
  
  Advanced Search 



JSI Tip 2621. Microsoft Task Scheduler Command Line Utility.

RSS
Subscribe to Windows IT Pro | See More Tips Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!


The Microsoft ® Task Scheduler Command Line Utility, jt.exe, allows you to manage the Task Scheduler from the command line

usage: JT {[options]|[@commandfile]}

options:

  @ <file>           - parse file
  /? [cmd]           - display help on [cmd], e.g. /? abj
  !<cmd>             - don't stop if command returns error
  /ABJ               - abort task
  /CSAGE             - convert SAGE tasks to tasks (Win9x only)
  /CTJ [<props>]     - create trigger in task
  /DTJ [<id>]        - delete trigger <id> (default 0) from task
  /EJ [<n> [T|F]]    - edit task page <n>, persist changes T/f
  /ENC <id1> <id2>   - enumerator clone <id1> from <id2> (see SCE command)
  /ENN <id> <n>      - enumerate next <n> items (see SCE command)
  /ENR <id>          - enumerator reset (see SCE command)
  /ENS <id> <n>      - enumerator skip forward by <n> (see SCE command)
  /GC                - get credential account name
  /GM                - get target machine
  /ISJQ <file>       - test <file> to see if it is a task
  /LJ <file>         - load task object from <file>
  /PJ                - print all properties of task
  /PRJ [<n>]         - print next <n> or today's remaining run times of task
  /PSJ [<id>]        - print trigger strings of <id> or all in task
  /PTJ [<id>]        - print trigger props of <id> or all in task
  /RJ                - run task
  /SAC <file>        - scheduler activate task (load tasks\<file>)
  /SAJ <file>        - scheduler add task (save as tasks\<file>)
  /SC <acct> <pwd>   - set task credentials
  /SCE <id>          - scheduler create enumerator in slot <id>=0..9
  /SD <file>         - scheduler delete task (delete tasks\<file>)
  /SE [<n>] [P]      - scheduler enum tasks <n> at a time, [P]rint
  /SJ <props>        - set task's properties
  /SM [<machine>]    - set machine (NULL = local machine if omitted)
  /SNJ <file>        - scheduler new task (replaces in-memory task object)
  /STJ [id] props    - set properties of task trigger <id> or 0
  /SVJ [<file>]      - save task to <file>

   For detailed help use: JT /? <command-name>, e.g. JT /? LJ.
Examples:
C:\>jt /se
[TRACE] Enumerating jobs and queues
  JSI005_State.job
  Windows Critical Update Notification.job

C:\>jt /se p
[TRACE] Enumerating jobs and queues
[TRACE] Activating job 'JSI005_State.job'
[TRACE] Printing all job properties

  ApplicationName:    'C:\Util\JSI005_State.bat'
  Parameters:         '
  WorkingDirectory:   'C:\Util'
  Comment:            '
  Creator:            'Jerry'
  Priority:           NORMAL
  MaxRunTime:         3600000 (0d  1:00:00)
  IdleWait:           10
  IdleDeadline:       60
  MostRecentRun:      07/18/2000 17:30:00
  NextRun:            07/19/2000 17:30:00
  StartError:         S_OK
  ExitCode:           0
  Status:             SCHED_S_TASK_READY
  ScheduledWorkItem Flags:
    DeleteWhenDone          = 0
    Suspend                 = 0
    StartOnlyIfIdle         = 0
    KillOnIdleEnd           = 0
    RestartOnIdleResume     = 0
    DontStartIfOnBatteries  = 0
    KillIfGoingOnBatteries  = 0
    RunOnlyIfLoggedOn       = 0
    SystemRequired          = 1
    Hidden                  = 0
  TaskFlags:          0

  1 Trigger

  Trigger 0:
    Type:            Daily
    DaysInterval:    1
    StartDate:       04/30/2000
    EndDate:         00/00/0000
    StartTime:       17:30
    MinutesDuration: 0
    MinutesInterval: 0
    Flags:
      HasEndDate      = 0
      KillAtDuration  = 0
      Disabled        = 0


[TRACE] Activating job 'Windows Critical Update Notification.job'
[TRACE] Printing all job properties

  ApplicationName:    'C:\WINNT\System32\wucrtupd.exe'
  Parameters:         '
  WorkingDirectory:   'C:\WINNT\System32'
  Comment:            'This task is created by
Windows Critical Update Notification program
and should not be modified or removed.'
  Creator:            'Jerry'
  Priority:           NORMAL
  MaxRunTime:         259200000 (3d  0:00:00)
  IdleWait:           10
  IdleDeadline:       60
  MostRecentRun:      07/18/2000 12:15:59
  NextRun:            07/19/2000 13:16:00
  StartError:         S_OK
  ExitCode:           0
  Status:             SCHED_S_TASK_READY
  ScheduledWorkItem Flags:
    DeleteWhenDone          = 0
    Suspend                 = 0
    StartOnlyIfIdle         = 0
    KillOnIdleEnd           = 0
    RestartOnIdleResume     = 0
    DontStartIfOnBatteries  = 1
    KillIfGoingOnBatteries  = 0
    RunOnlyIfLoggedOn       = 1
    SystemRequired          = 0
    Hidden                  = 0
  TaskFlags:          0

  1 Trigger

  Trigger 0:
    Type:            Daily
    DaysInterval:    1
    StartDate:       07/19/2000
    EndDate:         00/00/0000
    StartTime:       13:16
    MinutesDuration: 1440
    MinutesInterval: 5
    Flags:
      HasEndDate      = 0
      KillAtDuration  = 0
      Disabled        = 0
You can download JT.exe from ftp://ftp.microsoft.com/reskit/.

NOTE: See tip 5712.


End of Article



Reader Comments

You must be a registered user or online subscriber to comment on this article. Please log on before posting a comment. Are you a new visitor? Register now




Top Viewed ArticlesView all articles
WinInfo Short Takes: Week of November 23, 2009

An often irreverent look at some of the week's other news, including some post-PDC some soul searching, a Google Chrome OS announcement and a Microsoft response, Windows 7 off to a supposedly strong start, the Jonas Brothers and Xbox 360, and so much more ...

2009 Windows IT Pro Editors' Best and Community Choice Awards

Picking a favorite product from an impressive crowd of competitive offerings is never an easy task, and such was the case with our Editors' Best and Community Choice awards this year. ...

Command Prompt Tricks

One reader shares his tip for setting up the command prompt to reflect a remote path. ...


Related Events 7 Ways To Get More From Your SharePoint Deployment Now

Check out our list of Free Email Newsletters!

Related Resources Introducing Left-Brain.com, the online IT bookstore
Looking for books, CDs, toolkits, eBooks? Prime your mind at Left-Brain.com

Discover Windows IT Pro eLearning Series!
Clear & detailed technical information and helpful how-to's, all in our trademark no-nonsense format


Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro DevProConnections IT Job Hound
Left-Brain.com Technology Resource Directory asp.netPRO ITTV Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 © 2009 Penton Media, Inc. Terms of Use | Privacy Statement