2

I'm trying to launch a application with a UI at login on windows, using the task scheduler. I've came across some inconsistencies with this, sometimes the UI will launch properly, other time it wouldn't. By adding a delay to the task, I can safely make it executed ON MY COMPUTER.

How can I ensure this correct behavior on any given computer? Is it something to do with Windows UI not being "ready" or something like this ?

Any resource would be appreciated !

tukan
  • 17,050
  • 1
  • 20
  • 48
TmZn
  • 399
  • 5
  • 16
  • Have you seen this post? May be help you.https://superuser.com/questions/1097766/windows-task-scheduler-run-task-if-task-isnt-running – anilcemsimsek May 19 '20 at 12:16
  • Yes but this solution seems really hacky, it feels really strange that windows doesn't provide a direct solution – TmZn May 19 '20 at 12:24
  • Is Task scheduler necessary? or you just want start your application on startup? – anilcemsimsek May 19 '20 at 12:54
  • It is necessary since a regular startup will trigger UAC which is unwanted in this case – TmZn May 19 '20 at 12:55
  • :) ok got it. I didn't have any idea except hacky things or powershell scripts. Good luck! – anilcemsimsek May 19 '20 at 13:02
  • I'm still fuzzy on what you actually want. Could you be more specific, what works and what does not, give us a your example? (why you need task scheduler and e.g. the startup via shortcut is not enough?) Do you have AD when login? – tukan May 20 '20 at 13:57
  • @tukan When starting a task on login, if no delay is added, this task UI sometimes does not appear (completely randomly), and if I add a delay this fix it. But I tried on different computers and this delay need to vary depending on the computer. Also, I need to start from task scheduler and not from a normal startup shortcut because in the second case, this triggers an UAC prompt that is unwanted in this situation. – TmZn May 22 '20 at 17:20
  • @TmZn why do you use *task scheuler* for that? Why don't you use GPO (User Configuration > Policies > Windows Settings > Scripts (Logon/Logoff),)? – tukan May 22 '20 at 19:36
  • I can take a look at that but I’m pretty sure it will trigger UAC was well, the only way to avoid that afaik is task scheduling – TmZn May 30 '20 at 23:18

0 Answers0