Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a scheduled task under SYSTEM user account with SCHTASKS

I am currently trying to get SCHTASKS to create a scheduled task under the SYSTEM account, by using the following command:

schtasks.exe" /s "\\" /u "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR  "C:\test.exe "C:\""

Although it outputs:

ERROR: User credentials are not allowed on the local machine.
like image 541
Mike Avatar asked Jun 25 '11 12:06

Mike


People also ask

How do I run a scheduled task as a different user?

Double-click My Computer, then double-click Scheduled Tasks. Right-click the name of the scheduled task you want to modify, select Properties, and select the Task tab. In the "Run as" box, type the account name to use.

How do I schedule a Task without admin rights?

To allow non-admin users to view and run a task, find the task(s) in question and change permissions to allow Read and execute for your chosen user or group (as you would for any other file or directory).

What account does Task Scheduler use?

Windows user account The task should be scheduled to run under a service user account. Do not use a personal account, other than possibly temporarily for testing, since the schedule will stop working as soon as the password is changed. Usually, a local account on the server can be used.


1 Answers

  1. Open an elevated (admin) command prompt.

  2. Enter the following command:

    schtasks.exe /s "\" /ru "SYSTEM" /Create /SC DAILY /MO "7" /ST "12:00" /TN "mytask" /TR "C:\test.exe "C:\"

Please note the difference is that, in order to specify the SYSTEM account, you need to use the /RU switch and not the /U one.

like image 185
gonzobrains Avatar answered Oct 01 '22 13:10

gonzobrains