【问题标题】:Set task to run on system startup with cmd/schtasks使用 cmd/schtasks 将任务设置为在系统启动时运行
【发布时间】:2013-06-30 13:57:46
【问题描述】:

对于如何使用 schtasks 命令行将任务安排为在系统启动时以 SYSTEM 身份运行,我有点困惑,并且我已经阅读了 MS 在 schtasks.exe 上的文档。有人可以帮帮我吗?

【问题讨论】:

    标签: windows-task-scheduler


    【解决方案1】:

    以下命令安排 MyApp 程序在每次系统启动时运行,从 2001 年 3 月 15 日开始: 日期是可选的。

    schtasks /create /tn "My App" /tr c:\apps\myapp.exe /sc onstart /sd 03/15/2001
    

    【讨论】:

    • 用户应该是SYSTEM吧?还是我需要用 ru 参数指定它?
    • /sd 参数不适用于 Windows 10 的 /sc onstart
    【解决方案2】:

    使用 /RU SYSTEM 使任务作为系统运行。

    有关其他信息,请参阅 http://support.microsoft.com/kb/814596

    【讨论】:

      【解决方案3】:

      您可以指定用于任务级别和命令级别的帐户。

      /U to specify user account that should be used to run the actual command /RU to specify user account that should be used to execute the scheduled task

      默认情况下两者都将使用“系统”帐户,即具有登录用户的权限。

      更多详情:https://technet.microsoft.com/en-us/library/bb490996.aspx

      【讨论】:

      • 很高兴知道这一点。为了获得最佳可靠性,最好使用/ru SYSTEM /u SYSTEM 运行吗?为什么有 2 种不同的设置,它们何时重要?
      猜你喜欢
      • 2014-07-12
      • 2016-09-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-26
      • 2016-12-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多