How can I create a subfolder for taskscheduler in order to add my application's schedules inside that subfolder?
procedure TForm1.Button1Click(Sender: TObject); var ts : TTaskScheduler; tf: ITaskFolder; begin CoInitialize(nil); // uses ActiveX ts := TTaskScheduler.Create(Self); try ts.AutoConnect := True; ts.Connect1(GetNetComputerName); if ts.Connected then begin // ts.GetFolder('\MyFolder', ?sddl? ); << THIS DOESN'T WORK // As a workaround I create the folder myself. // System32 is changed into SysNative, as otherwise the folder would be created in SysWOW64. ForceDirectories('C:\Windows\SysNative\tasks\MyFolder\'); if DirectoryExists('C:\Windows\SysNative\tasks\MyFolder\') then tf := ts.GetFolder('\MyFolder') // << THIS GIVES AN UNKNOWN ERROR else tf := ts.GetFolder('\');
Gain unlimited access to on-demand training courses with an Experts Exchange subscription.Get Access
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE
Connect with Certified Experts to gain insight and support on specific technology challenges including: