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.
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.
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).
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.
Open an elevated (admin) command prompt.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With