FileNotFoundException

Jun 1, 2012 at 9:33 AM

Hi!

While using the taskService.GetFolder method i receive an exception saying FileNotFoundException: 'The system cannot find the file specified. (Exception from HRESULT: 0x80070002)'

After checking i found that the folder that i was trying to get was deleted from the WindowsTaskScheduler

Example:

taskService.GetFolder("My Tasks");

and the folder "My Tasks" got deleted from the Windows Task Scheduler.

I wanted to know that how can we check if the folder in which our tasks are stored exists or not so that i can check it before hand.

Thanks.

Coordinator
Jun 13, 2012 at 5:07 PM

There is no "HasFolder" method or anything like it. I would call the GetFolder method and handle the FileNotFoundException as an indicator that the folder does not exist.