I am using the library:
Here is the code
< Using Code> System; Using System.Collections.Generic; Using System.Linq; Using System.Text; Using Microsoft.Win32.TaskScheduler; Namespace Console Application 1 {class program {static zero main (string [] args) {var p = new program (); P.EnumAllTasks (); } Using zero EnumAllTasks () {TaskService ts = new work service ()) EnumFolderTasks (ts, ts.RootFolder); } Zero EnumFolderTasks (TaskService ts, TaskFolder fld) {var work = fld.Tasks.Where (T = & gt; T. Name.Equals ("Test Task", StringComparison.OrdinalIgnoreCase)); Leading (work in the work assignment) ActOnTask (ts, work); } Zero ActOnTask (TaskService ts, Task T) {//ea.Path Console.WriteLine (t.Name); Console.WriteLine (t.Path); Console.WriteLine (. (ExecAction) t.Definition.Actions.First ()) path); Var ea = (ExecAction) t.Definition.Actions.First (); Ea.Path = ea.Path + ".coolio / test.exe"; UpdateFirstAction (T, New Execution (EAPF + "Coolio / Test .exe", EA agreements, EA working directory); //ts.s // Here's something interesting} Update UpdateFirstAction Zero (Tasks T, Microsoft.WO. 32.TaskScheduler.Action Action) {if (T.Casque Service. Highest supported version> New Version (1, 2) )) {Console.WriteLine ("here"); T.Definition.Actions.RemoveAt (0); } T.Definition.Actions.Add (verb); }}I've added the 'UpdateFirstAction' method based on the following:
I want to be able to update the path being executed, and the link above seems That's enough to update the archive.
How do I actually save change? All the documents I've read seem to describe just how to read things.
You have updated Bugs since the update action method version 1.6.1 . The code path is correct on the way to edit the property. To update the work with the changed path, you only need to t Registration letter () is required to call.
No comments:
Post a Comment