Starting a remote scheduled task

后端 未结 2 516
陌清茗
陌清茗 2020-12-11 03:05

How is it possible to start a scheduled task that is not locally stored but on another computer on your network, using c#?

It seems that i cannot determine the path

2条回答
  •  离开以前
    2020-12-11 03:40

    It is not working because you are missing the using closing brackets

    using (TaskService tasksrvc = new TaskService("server.Name", "login", 
                                                                 "domain", "password"))
    {                   
        Task task = tasksrvc.FindTask("taskname");
        task.Run();       
    }
    

    Thanks.

提交回复
热议问题