65.9K
CodeProject is changing. Read more.
Home

Windows Mobile – tasker2 runs and stops applications periodically

emptyStarIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

0/5 (0 vote)

Dec 24, 2011

CPOL

7 min read

viewsIcon

13382

Tasker2 is a tool to launch or kill applications periodically using windows mobile scheduler. It was born to control the running of agent software on windows mobile at specified times.

Tasker2 is a tool to launch or kill applications periodically using windows mobile scheduler. It was born to control the running of agent software on windows mobile at specified times. The problem with the agent software was that it does not open/close connections only on usage times but all the time and the device’s battery was drain very fast. We decided to write a helper that would launch and kill the agent to have it running only within a defined time frame.

Background process

We could have written a background process to run external tasks periodically. But the main disadvantage of timers and threads in background processes is that they do not run, if the device is in suspend mode.
To ensure that tasks will be launched also if the device is sleeping, we decided to use the windows mobile scheduler. There are functions inside the notification API to create notifications that will run an application at a specified time. This is what we call a schedule.

The scheduler (notification API)

After a timed schedule has been done by the scheduler, the schedule is removed from the notification database. If you like to have a periodic schedule, you have to ensure that a new schedule is created inside your code.

Pitfalls

During development we found many pitfalls in conjunction with the windows mobile scheduler. This is why I decided to write this post.

The tasks

Tasker2 is a console application without any GUI but it will write a log with all you need to know. Tasker2 supports up to ten tasks. A task is defined using the registry. Every task has an entry for start and stop times, the application to control, an interval for the schedule and a flag for control if a task is only to be run on external power:

REGEDIT4

[HKLM\Software\Tasker\Task1]
"active":DWORD=1
"exe":="\Windows\fexplore.exe"
"arg":="\My Documents"
"start":="1423"
"stop":="1523"
"interval":="2400"
"startOnAConly":DWORD=0;

active: if active is 0, tasker2 will not kill or start the process
exe: name of the process executable to start or kill
arg: arguments to be when launching the executable
start: when to start the executable the next time
stop: when to kill the process the next time
interval: when a start or kill has been executed, tasker2 will create a new schedule using this interval. If the interval is “0010″, the start process will be scheduled for every 10 minutes.
startOnAConly: if 1 and when a process has to be started, the process will only be started if the device is on external power

The scheduler

First, tasker2 is normally only launched one time manually and all future calls are made by the scheduler. Tasker2 will clear and schedule all planned tasks as defined in the registry if it is launched without arguments.

The scheduler is a task manager running all the time in windows mobile. If a timed schedule is reached, the scheduler will launch the specified application, see also here . This will also work if the device is in suspend mode (sleeps). The scheduler can also fire on special events like time or hardware changes (ON_RS232_CONNECT for example). See also my post here [http://www.hjgode.de/wp/2010/03/06/irunatevent/].

Theory of operation

Tasker2 uses command line arguments to control itself. The scheduler launches tasker2 with the specified arguments and tasker2 will then run or kill the defined task.

Delayed schedules (pitfall 1)

If your device supports a real power down, the scheduler will not awake the device and is not able to launch the defined schedules. When the device is later powered on, it will schedule all past schedules at once. This is what we call a ‘delayed schedule’ and a flooding of launches. Flooding in the mean of many schedules of tasker2 occurring at the same time for past tasks.
To avoid concurrent changes to the registry and scheduler entries, tasker2 uses a mutex to ensure only one instance is continuing execution. Subsequent instances will wait for existing instances before they do there work.

  1. //##################### dont run if already running #############################
  2. nclog(L"Checking for Mutex (single instance allowed only)...\n");
  3.  
  4. hMutex=CreateMutex(NULL, TRUE, MY_MUTEX);
  5. if(hMutex==NULL){
  6. //this should never happen
  7. nclog(L"Error in CreateMutex! GetLastError()=%i\n", GetLastError());
  8. nclog(L"-------- END -------\n");
  9. return -99;
  10. }
  11. DWORD dwLast = GetLastError();
  12. if(dwLast== ERROR_ALREADY_EXISTS){//mutex already exists, wait for mutex release
  13. nclog(L"\tAttached to existing mutex\n");
  14. nclog(L"................ Waiting for mutex release......\n");
  15. WaitForSingleObject( hMutex, INFINITE );
  16. nclog(L"++++++++++++++++ Mutex released. +++++++++++++++\n");
  17. }
  18. else{
  19. nclog(L"\tCreated new mutex\n");
  20. }
  21.  
  22. //##################### dont run if already running #############################

On a delayed, flooding schedule ALL pending tasks are scheduled and possibly a Time_Changed string is sent to the pending tasks. This flooding will be serialized as tasker2 waits for existing tasker2 instances.

Time and time zone changes (pitfall 2)

When the time is changed on the device, the scheduler will inform all timed tasks. Tasker2 must then recalculate new schedules based on current local time. The scheduler launches the defined applications with the TIME_CHANGED string as argument.

  1. else if(wcsicmp(argv[1], APP_RUN_AFTER_TIME_CHANGE)==0 || wcsicmp(argv[1], APP_RUN_AFTER_TZ_CHANGE)==0){
  2. nclog(L"got '%s' signaled\n", argv[1]);
  3. //better to reread the current time we work with, possibly we have been blocked
  4. g_tmCurrentStartTime=getLocalTime(&g_tmCurrentStartTime);
  5. //now again check if we have a valid date
  6. nclog(L"Checking for valid date/time...\n");
  7. if( ((g_tmCurrentStartTime.tm_year+1900)*100 + g_tmCurrentStartTime.tm_mon+1) < 201111){
  8. nclog(L"scheduling event notifications\n");
  9. //clear and renew all event notifications
  10. #ifndef TESTMODE
  11. RunAppAtTimeChangeEvents(szTaskerEXE);
  12. #endif
  13. nclog(L"Date/Time not valid!\n*********** END ************\n");
  14. return 0xBADCAB1E;
  15. }
  16. nclog(L"Date/Time after 11 2011. OK\n");
  17.  
  18. //schedule all active tasks
  19. int iCount = scheduleAllTasks();
  20. nclog(L"Scheduled %i Tasks\n", iCount);
  21. }

Additionally we found that the time changes may also occur during program launch or as tasker2 instances wait for another tasker2 instance. So tasker2 uses only one (in real two) calls to get the current time. This is essential, as tasker2 uses the current time to re-schedule tasks. The current time is called at the beginning, before tasker2 waits for the mutex. This is the time tasker2 was launched. If there has been a time_changed schedule, tasker2 will use another call to the current time, as it may have changed between the launch and the further execution of the code – after the mutex is released and the current instance is allowed to run.

Delayed schedules II (pitfall 3)

As only one instance of tasker2 is executing, it may happen, that the current time and the task time do not match exactly. Although the scheduler may do its best to launch tasker2 at the right time, the execution may be delayed in regards of the time the task is to be scheduled and the current time. This is another delayed schedule compared to the above flooding of schedules after a power down/up cycle.
It may also happen that a lot of tasker2 instances are waiting for execution, you know that we can have up to ten tasks. This may also lead to ‘delayed’ code execution, but should be in a small time frame of some minutes only.
Therefor tasker2 supports a maximum allowed delay time to distinguish between allowed and flooding delayed calls.

  1. //is this a delayed schedule?
  2. nclog(L"\tchecking for delayed schedule...\n");
  3. int iDeltaMinutes;
  4. __time64_t ttStart;
  5. __time64_t ttStop;
  6. __time64_t ttCurr;
  7. ttStop = _mktime64(&(_Tasks[iTask].stStopTime));
  8. ttStart = _mktime64(&(_Tasks[iTask].stStartTime));
  9. ttCurr = _mktime64(&g_tmCurrentStartTime);
  10.  
  11. if(thisTaskType==stopTask){
  12. //difftime(timer1, timer0) returns the elapsed time in seconds, from timer0 to timer1
  13. iDeltaMinutes = difftime(ttCurr, ttStop)/60;// stDeltaMinutes(_Tasks[iTask].stStopTime, g_CurrentStartTime);
  14. nclog(L"stStopTime = '%s', ", getLongStrFromTM(_Tasks[iTask].stStopTime));
  15. }
  16. else{
  17. iDeltaMinutes = difftime(ttStart, ttCurr)/60;// stDeltaMinutes(_Tasks[iTask].stStartTime, g_CurrentStartTime);
  18. nclog(L"stStartTime = '%s', ", getLongStrFromTM(_Tasks[iTask].stStartTime));
  19. }

Adding a schedule

I am using central functions in code to add or remove schedules. Here is a sample of how a schedule is added:

  1. ...
  2. #include "notify.h"
  3. ...
  4. //--------------------------------------------------------------------
  5. // Function name : ScheduleRunApp
  6. // Description : add a schedule for exe with args at the time
  7. // Argument : LPCTSTR szExeName
  8. // Argument : LPCTSTR szArgs
  9. // Argument : struct tm tmTime
  10. // Return type : HRESULT, 0 for no error
  11. //--------------------------------------------------------------------
  12. HRESULT ScheduleRunApp(LPCTSTR szExeName, LPCTSTR szArgs, struct tm tmTime)
  13. {
  14. HRESULT hr = S_OK;
  15. HANDLE hNotify = NULL;
  16.  
  17. // set a CE_NOTIFICATION_TRIGGER
  18. CE_NOTIFICATION_TRIGGER notifTrigger;
  19. memset(&notifTrigger, 0, sizeof(CE_NOTIFICATION_TRIGGER));
  20. notifTrigger.dwSize = sizeof(CE_NOTIFICATION_TRIGGER);
  21.  
  22. // calculate time
  23. SYSTEMTIME st = {0};
  24. //GetLocalTime(&st); //v.2.28
  25.  
  26. st = convertTM2SYSTEMTIME(&st, &tmTime); //use provided new datetime
  27.  
  28. wsprintf(str, L"Next run at: %02i.%02i.%02i %02i:%02i:%02i",
  29. st.wDay, st.wMonth , st.wYear,
  30. st.wHour , st.wMinute , st.wSecond );
  31. nclog(L"\tScheduleRunApp: %s\n", str);
  32.  
  33. notifTrigger.dwType = CNT_TIME;
  34. notifTrigger.stStartTime = st;
  35.  
  36. // timer: execute an exe at specified time
  37. notifTrigger.lpszApplication = (LPTSTR)szExeName;
  38. notifTrigger.lpszArguments = (LPTSTR)szArgs;
  39.  
  40. hNotify = CeSetUserNotificationEx(0, &notifTrigger, NULL);
  41. // NULL because we do not care the action
  42. if (!hNotify) {
  43. hr = E_FAIL;
  44. nclog(L"\tScheduleRunApp: CeSetUserNotificationEx FAILED...\n");
  45. } else {
  46. // close the handle as we do not need to use it further
  47. CloseHandle(hNotify);
  48. nclog(L"\tScheduleRunApp: CeSetUserNotificationEx succeeded...\n");
  49. }
  50. return hr;
  51. }

The main code

The main function is processStartStopCmd() beside createNextSchedule(). It does all the scheduling and time calculations.

  1. /* ########################################################
  2. Process -s and -k comd line args
  3. ########################################################
  4. */
  5. //--------------------------------------------------------------------
  6. // Function name : processStartStopCmd
  7. // Description : calc new start/stop time, add schedules and start/kill application
  8. // Argument : TCHAR* argv[], the cmdLine array
  9. // Return type : int, 0 for no error
  10. //--------------------------------------------------------------------
  11. int processStartStopCmd(TCHAR* argv[]){
  12. int iReturn = 0;
  13.  
  14. BOOL bIsDelayedSchedule = TRUE; //used to save a delayed schedule situation
  15.  
  16. enum taskType{
  17. startTask = 1,
  18. stopTask = 2
  19. };
  20. taskType thisTaskType;
  21.  
  22. if(wcsicmp(argv[1], L"-k")==0) //kill taskX app
  23. thisTaskType=stopTask;
  24. else
  25. thisTaskType=startTask;
  26.  
  27. int iTask = getTaskNumber(argv[2]);
  28. if(_Tasks[iTask].iActive==1){
  29. //create a new schedule cmd line for tasker
  30. TCHAR strTaskCmdLine[MAX_PATH];
  31.  
  32. if(thisTaskType==stopTask)
  33. wsprintf(strTaskCmdLine, L"-k task%i", iTask+1); //the cmdLine for tasker.exe for this task
  34. else
  35. wsprintf(strTaskCmdLine, L"-s task%i", iTask+1); //the cmdLine for tasker.exe for this task
  36.  
  37. //clear all tasker schedules for taskX
  38. nclog(L"Clearing all schedules for Task%i with '%s'\n", iTask+1, strTaskCmdLine);
  39. notiClearRunApp(szTaskerEXE, strTaskCmdLine);
  40.  
  41. struct tm tmNewTime = {0};
  42. short shHour = _Tasks[iTask].stDiffTime.tm_hour;
  43. short shMin = _Tasks[iTask].stDiffTime.tm_min;
  44. short shDays = 0;
  45. if(shHour>=24){ //hour interval value is one day or more
  46. shDays = (short) (shHour / 24);
  47. shHour = (short) (shHour % 24);
  48. }
  49.  
  50. //is this a delayed schedule?
  51. nclog(L"\tchecking for delayed schedule...\n");
  52. int iDeltaMinutes;
  53. __time64_t ttStart;
  54. __time64_t ttStop;
  55. __time64_t ttCurr;
  56. ttStop = _mktime64(&(_Tasks[iTask].stStopTime));
  57. ttStart = _mktime64(&(_Tasks[iTask].stStartTime));
  58. ttCurr = _mktime64(&g_tmCurrentStartTime);
  59.  
  60. if(thisTaskType==stopTask){
  61. //difftime(timer1, timer0) returns the elapsed time in seconds, from timer0 to timer1
  62. iDeltaMinutes = difftime(ttCurr, ttStop)/60;// stDeltaMinutes(_Tasks[iTask].stStopTime, g_CurrentStartTime);
  63. nclog(L"stStopTime = '%s', ", getLongStrFromTM(_Tasks[iTask].stStopTime));
  64. }
  65. else{
  66. iDeltaMinutes = difftime(ttStart, ttCurr)/60;// stDeltaMinutes(_Tasks[iTask].stStartTime, g_CurrentStartTime);
  67. nclog(L"stStartTime = '%s', ", getLongStrFromTM(_Tasks[iTask].stStartTime));
  68. }
  69.  
  70. nclog(L"current time = '%s'\n", getLongStrFromTM(g_tmCurrentStartTime));
  71. nclog(L"interval is: %id%02ih%02im\n", shDays, shHour, shMin);
  72. nclog(L"\tdelta is %i minutes\n", iDeltaMinutes);
  73.  
  74. //started BEFORE scheduled time, iDelta is negative
  75. if(iDeltaMinutes<0){
  76. if(thisTaskType==stopTask){
  77. //calculate new schedules or leave them as is?
  78. //tmNewTime=_Tasks[iTask].stStopTime; //leave them as is
  79. tmNewTime=createNextSchedule(_Tasks[iTask].stStopTime, shDays,shHour,shMin); //calc new schedule
  80. }
  81. else{
  82. //tmNewTime=_Tasks[iTask].stStartTime; //leave them as is
  83. tmNewTime=createNextSchedule(_Tasks[iTask].stStartTime, shDays,shHour,shMin); //calc new schedule
  84. }
  85. #ifndef TESTMODE
  86. ScheduleRunApp(szTaskerEXE, strTaskCmdLine, tmNewTime);
  87. #endif
  88. nclog(L"*** re-scheduled future task *** \n");
  89. return 0;
  90. }
  91.  
  92. int iMaxDelay = getMaxDelay();
  93. nclog(L"\tmax allowed diff for delayed schedule recognition is plus %i\n", iMaxDelay);
  94.  
  95. if( iDeltaMinutes > iMaxDelay ) //is the time diff greater than 1 minute
  96. {
  97. bIsDelayedSchedule = TRUE;
  98. nclog(L"*** delayed schedule *** recognized\n");
  99. //this is a delayed schedule
  100. DOUBLE dbTimeDiff = 0;
  101.  
  102. //it may happen that the schedule is far in the future
  103. //we calc the next schedule on base of the current time by using the saved start/stop time
  104. //is just greater than the current time
  105. if(thisTaskType==stopTask)
  106. tmNewTime=_Tasks[iTask].stStopTime;
  107. else
  108. tmNewTime=_Tasks[iTask].stStartTime;
  109.  
  110. tmNewTime = createNextSchedule(tmNewTime, shDays, shHour, shMin);
  111. }
  112. else{
  113. nclog(L"*** NO delayed schedule *** recognized\n");
  114. if(thisTaskType==stopTask){
  115. tmNewTime = createNextSchedule(_Tasks[iTask].stStopTime, shDays, shHour, shMin);
  116. }
  117. else{
  118. tmNewTime = createNextSchedule(_Tasks[iTask].stStartTime, shDays, shHour, shMin);
  119. }
  120. bIsDelayedSchedule=FALSE;
  121. }
  122.  
  123. //create a new kill or start schedule with new time
  124. nclog(L"Creating new schedule for '%s' in Task%i\n", _Tasks[iTask].szExeName, iTask+1);
  125. #ifndef TESTMODE
  126. ScheduleRunApp(szTaskerEXE, strTaskCmdLine, tmNewTime);
  127. #endif
  128. //save new changed stop/start ime
  129. if(thisTaskType==stopTask)
  130. regSetStopTime(iTask, tmNewTime);
  131. else
  132. regSetStartTime(iTask, tmNewTime);
  133.  
  134. if(!bIsDelayedSchedule){
  135. nclog(L"Not a delayed schedule\n");
  136. if(thisTaskType==startTask){
  137. if(_Tasks[iTask].bStartOnAConly){
  138. if(isACpowered()){
  139. nclog(L"Starting exe '%s' as on AC power\n", _Tasks[iTask].szExeName);
  140. runExe(_Tasks[iTask].szExeName, _Tasks[iTask].szArgs);
  141. }
  142. else{
  143. nclog(L"Skipping start of exe '%s' as not on AC power\n", _Tasks[iTask].szExeName);
  144. }
  145. }
  146. else{
  147. nclog(L"Starting exe '%s'\n", _Tasks[iTask].szExeName);
  148. runExe(_Tasks[iTask].szExeName, _Tasks[iTask].szArgs);
  149. }
  150. }
  151. else{ // a stop task
  152. //now kill the task's exe
  153. nclog(L"Killing exe '%s'\n", _Tasks[iTask].szExeName);
  154. DWORD iKillRes = killExe(_Tasks[iTask].szExeName);
  155. switch (iKillRes){
  156. case ERROR_NOT_FOUND:
  157. nclog(L"\texe not running\n");
  158. break;
  159. case 0:
  160. nclog(L"\texe killed\n");
  161. break;
  162. default:
  163. nclog(L"unable to kill exe. GetLastError=%08x\n", iKillRes);
  164. break;
  165. }
  166. }
  167. }
  168. else{
  169. nclog(L"Exec/Kill skipped as this is a delayed schedule\n");
  170. }
  171. }
  172. else
  173. nclog(L"\ttask %i is inactive (0x%02x)\n", iTask, _Tasks[iTask].iActive);
  174.  
  175. return iReturn;
  176. }

 Tasker2 control

Although you normally dont need to run tasker2 manually, I have added some command line arguments:

“-c”    instructs tasker2.exe to remove all tasker2 schedules of the scheduler database
“-r taskX”    deactivate processing of task with number X, sets the active flag to 0
“-a taskX”    activate processing of task number X, sets the active flag to 1
“-d”    dump a list of all active notifications of the windows mobile scheduler

Do not use -s taskX and -k taskX except for testing. The args ‘-s taskX’ and ‘-k taskX’ are only be used by the scheduler.

Log file

The log file will log all activities of tasker2 in the directory of tasker2.exe. It will grow until 1MB and then one log backup file is saved. So you may have two log files, one active and one backup of the previous log.

  1. 0xfacbcab2: ++++++++++++++++ Tasker v300 started +++++++++++++++++++
  2. 0xfacbcab2: Checking for Mutex (single instance allowed only)...
  3. 0xfacbcab2: Created new mutex
  4. 0xfacbcab2: ~~~ using actual localtime:
  5. 0xfacbcab2: 23.12.2011, 12:28
  6. 0xfacbcab2: CmdLine =
  7. 0xfacbcab2: Checking for valid date/time...
  8. 0xfacbcab2: Date/Time after 11 2011. OK
  9. 0xfacbcab2: Clearing Event Notifications...0xfacbcab2: OK
  10. 0xfacbcab2: ClearRunApp(): ...
  11. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3d00000f
  12. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x33000025
  13. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3800002a
  14. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3b00001b
  15. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3800002e
  16. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3f00001e
  17. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x37000016
  18. 0xfacbcab2: ClearRunApp(): CeClearUserNotification for handle: 0x3a000030
  19. 0xfacbcab2: ClearRunApp(): returns 8
  20. 0xfacbcab2: Cleared 8 Tasker schedules
  21. 0xfacbcab2: scheduleAllTasks: ClearAllSchedules for 8 tasks
  22. 0xfacbcab2: Clearing Event Notifications...0xfacbcab2: Clearing Event Notifications...0xfacbcab2: OK
  23. 0xfacbcab2: Adding Time_Change Event Notification...0xfacbcab2: OK
  24. 0xfacbcab2: Adding TZ_Change Event Notification...0xfacbcab2: OK
  25. 0xfacbcab2: Creating new Start Task schedule for '\Windows\notes.exe' in Task1
  26. 0xfacbcab2: calculating new schedule for '201112231300'...
  27. 0xfacbcab2: interval is: 0d01h00m
  28. 0xfacbcab2: schedule adjusted to '201112231300'
  29. 0xfacbcab2: ScheduleRunApp: Next run at: 23.12.2011 13:00:56
  30. 0xfacbcab2: ScheduleRunApp: CeSetUserNotificationEx succeeded...
  31. 0xfacbcab2: Creating new Kill Task schedule for '\Windows\notes.exe' in Task1
  32. 0xfacbcab2: calculating new schedule for '201112231300'...
  33. 0xfacbcab2: interval is: 0d01h00m
  34. 0xfacbcab2: schedule adjusted to '201112231300'
  35. 0xfacbcab2: ScheduleRunApp: Next run at: 23.12.2011 13:00:56
  36. 0xfacbcab2: ScheduleRunApp: CeSetUserNotificationEx succeeded...
  37. ...

The first entry in the log file is the current logging instance. As multiple instances may write randomly at the log, the instance number is needed to idetify which instance has written the current log line.

Changes

There are two variants of tasker2, one is using SYSTEMTIME and the other, new one uses time_t. I switched to time_t as it is more easy to do operations like add-one-day with time_t vars than with SYSTEMTIME.

The old variant (v234a) is available as a branch in the code repository: http://code.google.com/p/tasker2/source/browse/#svn%2Fbranch%2Fversion232%2FTasker

Tests

Fortunately I had great help by a tester of the software. Many thanks to Thomas B.

I built my only automatic test suite using batch files and a special build of tasker2.exe. If you uncomment the line //#define TESTMODE at the beginning of tasker2.cpp, the compiled app will be in test mode. That means it will not add or remove schedules to/from the windows mobile scheduler. There is another tool used in the test_run.bat that sets the date and time of the device remotely (ActiveSync or Windows Mobile Device Center connection).

The automatic test uses the great tools of itsutils and will set registry values, change date/time, launch tasker2, get the log and build a merged log with all essential data to check the function of tasker2:

http://code.google.com/p/tasker2/source/browse/#svn%2Ftrunk%2FTasker%2Ftest

Here is a snippet from the test_bat.bat:

  1. @echo off
  2.  
  3. ECHO ############## START ###############
  4. echo MAKE SHURE THE RADIOS ARE OFF TO
  5. echo AVOID AUTOMATIC TIME SYNCS!
  6. echo .
  7. PAUSE Press any key to start
  8.  
  9. ECHO ############## START ############### >test_run.txt
  10.  
  11. echo Importing test reg keys...
  12. echo Importing test reg keys... >>test_run.txt
  13. pregutl @tasker2.reg >>test_run.txt
  14.  
  15. pdel \tasker2.exe.log.txt >NUL
  16. pput -f ./tasker2.exe \tasker2.exe
  17.  
  18. ECHO TEST1...
  19. ECHO set time manually to 01.01.2003 12:00
  20. echo run tasker2.exe
  21. ECHO ++++++++++++++ TEST1 ++++++++++++++++ >>test_run.txt
  22. pregutl HKLM\Software\Tasker >>test_run.txt
  23. ECHO ------------------------------------- >>test_run.txt
  24. ECHO set time manually to 01.01.2003 12:00 >>test_run.txt
  25. ECHO ------------------------------------- >>test_run.txt
  26. prun \SetDateTime.exe 200301011200
  27. CALL :MYWAIT
  28. prun \tasker2.exe
  29. ECHO "############# Result:" >>test_run.txt
  30. pregutl HKLM\Software\Tasker >>test_run.txt
  31. ECHO *************** LOG **************** >>test_run.txt
  32. pget -f \tasker2.exe.log.txt
  33. type tasker2.exe.log.txt >>test_run.txt
  34. pdel \tasker2.exe.log.txt
  35. ECHO ---------------TEST1 --------------- >>test_run.txt
  36. ECHO .>>test_run.txt

Downloads

The full tasker2 source code is available at http://code.google.com/p/tasker2/source/browse

Tool to look at the scheduler database [NotificationList]: DOWNLOAD:NotificationList - A tool to list notifications (Hits: 1, size: 153.42 kB)

 

<!-- Social Bookmarks BEGIN --> <!-- Social Bookmarks END -->