访问Windows计划任务使用C#任务、计划、Windows

2023-09-02 20:46:55 作者:全村娘们的指望

如何更改使用C#.NET使用计划任务的凭据?

How do I change the credentials used by a scheduled task using C#.NET?

推荐答案

而不是使用code,你可以做到这一点使用'schtasks的命令,使用System.Diagnostic.Process.Start方法所需的参数运行。它要求简单,没有太多的精力。

Instead of using code, you can do it using 'SCHTASKS' command, run it using System.Diagnostic.Process.Start method with the parameters required. It's easy and not much effort required.