How to start a scheduled task launch so that it is interactive

I can’t understand how to carry out the scheduled task at startup , it is being executed, but only in the background, and not in the interactive mode, although I set the task parameter to interactive:

Register-ScheduledJob -Name runatstartup `
    -ScriptBlock { start chrome } `
    -Trigger (New-JobTrigger -AtStartup)

Set-ScheduledTask -TaskName runatstartup `
    -TaskPath Microsoft\Windows\PowerShell\ScheduledJobs `
    -Principal (New-ScheduledTaskPrincipal -Logontype Interactive -Userid $env:USERNAME)

The same team is working normally, the program appear normal, if I replace -atstartupon -atlogonor -once, -daily. Can anyone help me with this?

+4
source share
1 answer

AtStartup , , " ". ( ) , .

AtLogin, - , , , , , , .

+2

Source: https://habr.com/ru/post/1618715/


All Articles