Set task to run on system startup schtasks command line

情到浓时终转凉″ 提交于 2019-12-23 09:35:22

问题


I am a bit confused on how to schedule a task to run on system startup as SYSTEM with schtasks command line and I have read MS's documentation on schtasks.exe. Can someone here help me.


回答1:


The following command schedules the MyApp program to run every time the system starts, beginning on March 15, 2001: the date is optional.

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



回答2:


Using /RU SYSTEM makes a task run as the system.

For additional info, see http://support.microsoft.com/kb/814596




回答3:


You can specify account to use for both at task level as well as at command level.

/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

By default both would use "System" account i.e. with the permissions of the user logged in.

For more details: https://technet.microsoft.com/en-us/library/bb490996.aspx



来源:https://stackoverflow.com/questions/17438482/set-task-to-run-on-system-startup-schtasks-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!