Is it possible to change, by using command-line, this first state in my Windows Task Scheduler (sorry, my Windows is in spanish; look for translation on the bottom):

Scheduled task that needs user login to run

to this other?

Scheduled task with no need of user login to run

Only change (approximate translation):

"Run only if the user has logged in"


"Run even when user has not logged in"

If modification via command-line is not possible, I could workaround by creating again the task. I need to solve it for Windows 7, but could be useful for Windows XP too.

EDIT: The program executed is this "Prueba02.cmd":

echo Prueba02 >> c:\Temporal\SchedTasks\Prueba02.txt

You need to provide a user for the task to run as. For example /RU system

See schtasks /Change /? for more info, especially /RU, /RP, and /NP

  • Thanks, @adam, but what is /NP? I can not find it in the docs. – Sopalajo de Arrierez Mar 15 '14 at 22:39
  • /NP A value that indicates that no password is stored. The task does not run interactively as the given user. Only local resources are available. See: ss64.com/nt/schtasks.html – adam Mar 15 '14 at 22:44

I believe so, using the Windows utility Schtasks.

Look for the parameter /RU.

/RU username

A value that specifies the user context under which the task runs. For the system account, valid values are, NT AUTHORITY\SYSTEM, or SYSTEM. For Task Scheduler 2.0 tasks, NT AUTHORITY\LOCALSERVICE, and NT AUTHORITY\NETWORKSERVICE are also valid values.


SCHTASKS /Create /TN MyTask /TR "C:\MyTask.bat" /SC ONSTART /RU SYSTEM

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.