I have a doubt that I'm doing a console that creates a task scheduled in windows, when I put the windows credentials I create the task without problems, the problem is that I need to create that scheduled task without credentials, some idea of how to do it?
here the code:
using (ScheduledTasks Tareas = new ScheduledTasks())
{
TaskScheduler.Task tarea = Tareas.CreateTask("Reprogramando");
Tareas.DeleteTask("Reprogramando");
tarea.ApplicationName = @"C:\Users\"+userName+"\Desktop\Programa.exe";
tarea.Comment = "Tarea reprogramada del programa semanal";
// Acá deseo que se cree sin la SetAccountInfo
tarea.SetAccountInformation("userName", "Password");
// limitar la duración de la tarea programada
tarea.MaxRunTime = new TimeSpan(0, 15, 0);
tarea.Creator = "Ac";
// prioridad de la tarea
tarea.Priority = System.Diagnostics.ProcessPriorityClass.Normal;
tarea.Triggers.Add(new RunOnceTrigger(task.AddHours(1)));
tarea.Save();
}