Feb 5 2010

How to run a scheduled task via a batch job

Category: Windows Ryan @ 02:52

Assuming XP...

C:\>schtasks /?

SCHTASKS /parameter [arguments]

Description:
Enables an administrator to create, delete, query, change, run and
end scheduled tasks on a local or remote system. Replaces AT.exe.

Parameter List:
/Create Creates a new scheduled task.

/Delete Deletes the scheduled task(s).

/Query Displays all scheduled tasks.

/Change Changes the properties of scheduled task.

/Run Runs the scheduled task immediately.

/End Stops the currently running scheduled task.

/? Displays this help/usage.

Examples:
SCHTASKS
SCHTASKS /?
SCHTASKS /Run /?
SCHTASKS /End /?
SCHTASKS /Create /?
SCHTASKS /Delete /?
SCHTASKS /Query /?
SCHTASKS /Change /?

C:\>schtasks /run /?

SCHTASKS /Run [/S system [/U username [/P password]]] /TN taskname

Description:
Runs a scheduled task immediately.

Parameter List:
/S system Specifies the remote system to connect
to.

/U username Specifies the user context under
which the command should execute.

/P password Specifies the password for the given
user context.

/TN taskname Identifies the scheduled task to run.

/? Displays this help/usage.

Examples:
SCHTASKS /Run /?
SCHTASKS /Run /TN "Start Backup"
SCHTASKS /Run /S system /U user /P password /TN "Backup and Restore"

Tags: ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5