Subscribe my articles from SELaplana:
Delivered by FeedBurner
 

Windows Scheduling

Computer >>> Laptop

Schedule Your Windows Tasks

  • How many repetitive tasks do you perform manually on your PC at home or work?
  • What tasks do you perform which need all users to logout of the system during work hours?

  • If you are working within Windows then you can use Schtasks, which ships with Windows, to perform those tedious tasks for you.

    Schtasks is a tool you can use to carry out a task at a particular time, date or day. You can use Schtasks to run VBScripts, Batch files or any kind of executable application that can be fired up from the command line within the console window. For instance, if you have a Windows service running, which for whatever reason needed bouncing every morning or after a weekend power down, you could write a VBScript to bounce the service and schedule it to run at an appropriate time. Here is an example of how you would set a schedule via Schtasks to bounce a service via a VBScript at 3 am every morning on business days Monday to Friday:

    schtasks /create /tn bounce_service /sc mon,tue,wed,thu,fri /st 3:00 /tr "c:my scriptsbounce.vbs"

    If you are using Schtasks on your PC, and not on a server, then you would not switch off your PC running when you leave work and let SchTasks can run your tasks overnight. Your last task on your PC might be to shutdown your PC. Schtasks does provide the ability to start up your computer at a specific time but I have found this a bit problematic to get working on some PCs.

    Here are some ideas for using Schtasks:

    • Backup files when your computer is idle or at the end of a working day.
    • Run overnight processes when no users are logged onto a server, database or application.
    • Start up or shut down your PC.
    • Compact databases.
    • Compile multi-developer applications.
    • Perform web publishing overnight when resources are free.
    • FTP data across a network when bandwidth usage is low.
    • Start, stop or bounce Windows services.

    Using Schtasks will reduce your manual labour, ensure consistent processing without human error, and buy you time to do other things.

    For complete instructions on using Schtasks see: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/schtasks.mspx

    Duane Hennessy
    Senior Software Engineer and Systems Architect
    Bandicoot Software
    Tropical Queensland, Australia
    (ABN: 33 682 969 957)

    Your own personal library of code snippets. http://www.bandicootsoftware.com.au

    Moderator of http://groups.yahoo.com/group/AccessDevelopers

    Search Lyrics by Artists: 0-9 - A - B - C - D - E - F - G - H - I - J - K - L - M - N - O - P - Q - R - S - T - U - V - W - X - Y - Z