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.
Asked
Active
Viewed 3.1k times
3 Answers
14
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

stevec
- 41,291
- 27
- 223
- 311

Santanu Kumar
- 159
- 9
-
2The user will be SYSTEM right? or do I need to specify it with the ru parameter? – user2527738 Jul 03 '13 at 02:16
-
1the `/sd` parameter doesnt apply for `/sc onstart` for windows 10. – alpha_989 May 24 '18 at 16:49
4
Using /RU SYSTEM makes a task run as the system.
For additional info, see http://support.microsoft.com/kb/814596

fpintos
- 151
- 8
2
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

sactiw
- 21,935
- 4
- 41
- 28
-
This is good to know.. For the best reliability, is it then best to run with `/ru SYSTEM /u SYSTEM`? Why are there 2 different settings and when do they matter? – alpha_989 Jun 10 '18 at 03:05