delphi ITaskFolder.RegisterTaskDefinition not working
问题 I'm trying to create a task to windows task scheduler. Here's the code. procedure TForm1.Button1Click(Sender: TObject); var ts: ITaskService; tf: ITaskFolder; tf2: ITaskFolder; td: ITaskDefinition; tr: ITrigger; tt: ITimeTrigger; at: IAction; ae: IExecAction; rt: IRegisteredTask; begin CoInitializeEx(nil, COINIT_MULTITHREADED); CoCreateInstance(CLSID_TaskScheduler,nil,CLSCTX_INPROC_SERVER,IID_ITaskService,ts); ts.Connect(unassigned, unassigned, unassigned, unassigned); try tf := ts.GetFolder(