Running a scheduled task

  Previous topic Next topic JavaScript is required for the print function Mail us feedback on this topic! Mail us feedback on this topic!  

The following sample code shows how you can run an existing scheduled task:

 

[C#]

 

using CMS.Scheduler;

 

...

 

        string taskName = "TestContentPublishing";

        string siteName = "CorporateSiteASPX";

 

        // Get task object

        TaskInfo ti = TaskInfoProvider.GetTaskInfo(taskName, siteName);

 

        // If task exists

        if (ti != null)

        {

            // Run task

            SchedulingExecutor.ExecuteTask(ti);

 

        }

 

Page url: http://devnet.kentico.com/docs/5_5r2/devguide/index.html?api_running_a_scheduled_task.htm