Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hello,

When using schtasks.exe, I can easily change "Run as" to be System (NT AUTHORITY\SYSTEM), with /RU option.

I want to see task creator (under creator in Scheduled Tasks folder) to be System as well (now I see there my username).

How can I do it?
(If I use AT.exe the creator is autimatically System)

Thanks
Posted
Updated 28-Mar-11 6:41am
v2
Comments
Dalek Dave 28-Mar-11 12:42pm    
Edited for Grammar and Readability.

You can't. You cannot give a process more permissions that you already have.

If the process needs to run as System, a process already running as System has to launch it itself.
 
Share this answer
 
Comments
user_code 28-Mar-11 11:30am    
Are you sure? because at.exe creator is System.
Dave Kreskowiak 28-Mar-11 18:55pm    
Yes, I'm sure. AT is run by the user, not the system. The Task Scheduler service runs under svchost under Local System. Any tasks launched by the Task Scheduler have the option of running as System.

The exact same thing applies to SchTasks. SchTasks tells the Task Scheduler service which account to use. A normal user cannot tell TS to use the System account. The Task Scheduler launches the command and can launch it as System because the Task Scheduler service runs under the System account.

The same limitation of users not being able to grant priv's above themselves applied to any code running on the system. Code cannot grant permissions to anything above the account the code is running under.
Hello again,
What happens when you use the command line option /RU "SYSTEM". From my reading of the documentation[^] that should solve the problem, assuming you run schtasks from an administrator account.

SCHTASKS /Create /SC hourly /TN Task1 /TR "notepad.exe" /RU "SYSTEM"


Alan.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900