1

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"

to

"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

2 Answers 2

1

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

2
  • Thanks, @adam, but what is /NP? I can not find it in the docs. Mar 15, 2014 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, 2014 at 22:44
1

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.

Example:

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .