Windows 10 – How to Run an Interactive Scheduled Task for Any User

scheduled-tasktask-schedulerwindowswindows 10

I want to setup a windows 10 task scheduler to run a GUI based tasked interactively for any logged on user. Right now we have to explicitly specify the user name, so the task can only be run for this specific user. This scheduled task will be deployed on 1000s of computers for 100s of companies – all Windows 10, but of many, many difference configurations (pro, enterprise, OEM, site modified).

Looking at other scheduled tasks I see two possibilities:

"nt authority\interactive" – this is used by adobe acrobat update task

"Builtin\users" – this is used by some office tasks

Will either of these work for my purpose? Are they the "right" group to use that can be deployed on many disparate Win10 installations?

thanks!

Best Answer

As you want the application to start when any user logs on, I'd suggest the builtin\users security context. If the application needs admin rights, you would need to do a few things differently. Here's an example of the syntax you would use to have notepad run whenever a user logs on:

schtasks /create /ru builtin\users /sc onlogon /tn "Notepad On Logon" /tr C:\windows\system32\notepad.exe

Keep in mind, your installer will need admin rights to add the scheduled task.

Another thing to keep in mind: if the path to your executable has spaces, you'll need to use both double and single quotes around the path. So you'd use something like this:

/tr "'C:\path with spaces\myApplication.exe'"