CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2009
    Posts
    12

    ITaskScheduler: how to refresh / removed cached schedule?

    I could create a new task and set its interval. This task will successfully invoke the application specified in the task. However I encounter another problem: I can't modify the task to set to new interval in XP (Win7 doesn't have this problem). What I did was: first delete the original task; and the create a new task with new interval.

    In the UI (Task Manager), it seems everything is fine (showing the new interval). However the application is still invoked at the original interval. If I re-boot my machine, the new task will work. So it seems to me that Windows is still using the cached task (although it had been deleted) rather than the new one.

    However, I can't force the user to reboot machine if the task schedule is changed. Is there a way to force removing the cached task by Windows / doing a Refresh?

    Thanks in advance.

    Leo

  2. #2
    Join Date
    Jul 2009
    Posts
    12

    Re: ITaskScheduler: how to refresh / removed cached schedule?

    Found the workaround by myself:

    After I delete the original task using the original task scheduler, I assign the original one to be NULL, and then cocreate it again. Then I juse the new scheduler to create the modified task. It works fine on XP and Win7 now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured