1

My custom task scheduler is working fine in Windows XP, but it throws an Access Denied error in Windows 7.

The reason is that Windows 7 is not storing the tasks under C:\Windows\Tasks. It stores it under C:\Windows\System32\Tasks. But my task scheduler tries to store the tasks under C:\Windows\Tasks that leads to an error.

I am using ITaskSchedular and the ITask COM interface; I want to change the RootFolder of ITaskSchedular, but I couldn't.

I don't have admin rights; that's why it throws this error. An administrator would be able to run my scheduler properly.

Ben
  • 51,770
  • 36
  • 127
  • 149
Ruby David
  • 11
  • 1
  • can you post some code – gofor.net May 16 '13 at 12:06
  • t.Save(); where t is ITask. – Ruby David May 17 '13 at 06:28
  • 1
    t.Save(); where t is ITask. The fn Save is......................... public void Save() { IPersistFile iFile = (IPersistFile)iTask; iFile.Save(null, false); iFile.SaveCompleted(null); } I tried to change the path explicitly.. string path = "C:\\Windows\\System32\\Tasks\\" + t.Name + ".job"; t.Save(path);... Now I didnt get any error.. and i could see the task in MS Task Schedular Library... But the task Action items are empty and hence not able to run it successfully – Ruby David May 17 '13 at 06:40
  • and also I tried to give read and write permission using icacls for the folder C:\Windows\Tasks.. It said, successfully processed dir.. but still my task schedular throws Access Denied error.. – Ruby David May 17 '13 at 06:41
  • This is happening for me as well on windows server 2012 – srossross Sep 24 '14 at 14:37

0 Answers0