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

Mike picture Mike · Jun 25, 2011 · Viewed 71.8k times · Source

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.

Answer

gonzobrains picture gonzobrains · Jul 13, 2013
  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.