ContactEZ.net D. G. Schneider International Lions Club Volunteer Project

ContactEZ.net

Automate Recurring Tasks

A recurring task will repeat at regular intervals or repeat based on the date you mark the task complete.

Create a recurring task for backups and archives on CD

You might want to create a recurring task to start the monthly personal backup.
For example: Last Friday of every month.
The following topic will discuss how to create a batch file and an automated process to backup files on a CD.
The same approach can be used for other tasks.

Every file that is copied to the C:\Documents and Settings\yourusername\Local Settings\Application Data\Microsoft\CD Burning folder will be included to the set of files to be written on the CD.
The process of copying a set of files to this folder can be automated.
You can for example create a batch file that copies the set of selected files and folders to write on a CD and automate the execution of that batch file.
Once the selected files are copied to C:\Documents and Settings\yourusername\Local Settings\Application Data\Microsoft\CD Burning windows will display a message to let you know that you have files waiting to be written to the CD.
You have files waiting to be written to the cd.
To see the files now click on the balloon

At that point insert a CD and follow the prompt of the Windows XP CD Writing Wizard.
For more information on how to create a CD read the Windows Help.

Example of a batch file to copy files to be written on a CD:


@echo off
rem MYBACKUP.BAT transfers all selected files in all subdirectories of the source drive or directory (%1) 
rem to the destination drive or directory (%2)
rem if you want to give these arguments at the command line, uncomment the following line:
rem xcopy %1 %2 /s /e

rem For this sample example we will copy the outlook personal mail folders of the user and 2 other personal folders.
rem In that case the sources and locations are hard coded in the batch file

More hints about Outlook Automation Macros from ContactEZ assistant in Gurley Alabama

XCopy D:\users\MyOutlookMail\*.* "C:\Documents and Settings\Your_user_name\Local Settings\Application Data\Microsoft\CD Burning\mailbackup\MyOutlookMail" /S /E

XCopy D:\development\AutostartinVC\*.* "C:\Documents and Settings\Your_user_name\Local Settings\Application Data\Microsoft\CD Burning\AutostartinVC\" /S /E

XCopy D:\development\code4localization\*.* "C:\Documents and Settings\Your_user_name\Local Settings\Application Data\Microsoft\CD  Burning\code4localization\" /S /E

if errorlevel 4 goto lowmemory
if errorlevel 2 goto abort
if errorlevel 0 goto exit

:lowmemory
echo Insufficient memory to copy files or
echo invalid drive or command-line syntax.
goto exit

:abort
echo You pressed CTRL+C to end the copy operation.
goto exit

:exit


Create a task that recurs at regular intervals using Sheduled Tasks

Create a task that recurs at regular intervals using Outlook

Create a task that recurs at regular intervals using schtasks

schtasks is a new Windows XP Professional command-line tools.   This tools Schedules commands and programs to run periodically or at a specific time. Adds and removes tasks from the schedule, starts and stops tasks on demand, and displays and changes scheduled tasks. SchTasks.exe performs operations similar to those in Scheduled Tasks in Control Panel. You can use either tool to create, delete, configure, or display scheduled tasks. To verify that a scheduled task ran or to find out why a scheduled task did not run, see transaction log, Systemroot\SchedLgU.txt. This log records attempted runs initiated by all tools that use the service.

General Monthly Schedule Syntax
schtasks /create /tn TaskName /tr TaskRun /sc monthly [/mo {FIRST | SECOND | THIRD | FOURTH | LAST | LASTDAY] [/d {MON - SUN | 1 - 31}] [/m {JAN - DEC[,JAN - DEC...] | *}] [/st StartTime] [/sd StartDate] [/ed EndDate] [/s computer [/u [domain\]user /p password]] [/ru {[Domain\]User | "System"} [/rp Password]]

To schedule a task for the first day of every month
schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly

To schedule a task for the last day of every month
schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo lastday /m *

To schedule a task for the second Friday of every month
schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc monthly /mo SECOND /d FRI

See the Windows Help and Support center for more information. Search for: schtasks

Create a task that recurs at regular intervals using AT command line

The AT command schedules commands and programs to run on a computer at a specified time and date. To assign a scheduled task, open a Command Prompt (DOS window) and type AT with the desired parameters. Used without parameters, at lists all scheduled commands.

For example:
at 14:45 c:\backup.bat ^>c:\backup.log

at 2:30 /interactive /every:M cmd /c "c:\backups\bin\mybackup.bat Monday >c:\backups\logs\bckup.log"

About Dominique Gérard Schneider since 1995
Participation on Google
ContactEZ.net on YouTube

Tek-Tips Forums dgschnei
Listed since 1996 ixquick
Community Services

platform sdk dgschnei
Cooperation
About Me

Return Home- Index