Scheduling Windows tasks from the command prompt
Tasks,processes,commands can be scheduled in Windows through Task Scheduler.
But is it possible to do this through few lines using the command prompt?
This is where the "at" command is useful.

Administrator access is needed to schedule,modify or delete tasks using the "at" command.
Suppose the box needs to be shutdown at 7 pm today,this can be done by simply typing
at 19:00 shutdown -s

This will add this particular task in scheduler's queue which can be listed by typing just "at".
I recommend to first check the queue using this command to make sure there are no previous similar jobs queued to avoid conflict.
What if some files need to be copied from one folder to the other at a specified time automatically?
Again "at" is to the rescue.
To copy all files from the Documents folder to the Somedata folder at midnight, type the following line, and then press ENTER:
at 00:00 cmd /c copy C:\Documents\*.* C:\Somedata

If you want to delete scheduled tasks from the queue,issue the at
at 1 /delete deletes task with id 1
at 2 /delete deletes task with id 2
at /delete will delete all pending tasks

Feel free to try out the various nuances of at as it can be very quick and powerful to automate routine tasks.
Cheers.

June 9, 2010 10:47 AM
Freakin' unbelievable stuff.
I never knew what AT really was or let alone that command window was this powerful.
Please do more posts on things like these.
Bless,
Prasen
June 9, 2010 11:11 AM
@ Prasen
That's what scripting is all about.Few lines of commands and code automating tasks and making tedious things easier to manage.
Will definitely post more of this similar stuff.
Thanks for reading.