Creating a scheduled task using bat script command:
SCHTASKS /Create /RU "user" /RP "password" /TN "name" /XML "file.xml" /F
Nothing in the XML seems to set the option to "Run only when user is logged in". Adding the /it option on the SCHTASKS command doesn't make any difference other than generating this warning:
WARNING: The task is registered, but not all specified triggers will start the task, check task scheduler event log for detailed information.
How can I create a scheduled task and set the "Run only when user is logged in" option using scripts?