locked
Scheduled task always runs on default desktop? RRS feed

  • Question

  • I have a few "on demand" scheduled tasks.  And I use alternative desktops supplied by SysInternals\Desktops.  Whenever I run one of those tasks, either from the Scheduled Tasks MMC applet or with "schtasks.exe /run /tn ...", it runs on the default desktop, regardless of which is the current I/O desktop.

    Is there any way around this (or a more appropriate forum in which to ask)?

    Thanks.

     - Vince

    Tuesday, May 22, 2012 1:57 AM

Answers

  • Hi,

    I think your purpose may not be achieved, but you can also try to post at http://technet.microsoft.com/en-us/sysinternals/bb469929.aspx for help.


    Juke Chou

    TechNet Community Support


    • Edited by Juke Chou Wednesday, May 23, 2012 9:07 AM
    • Marked as answer by Juke Chou Tuesday, June 5, 2012 10:00 AM
    Wednesday, May 23, 2012 9:06 AM
  • There is a straightforward work-around.  Let the task scheduler run a "shim" app with the real target command line specified in its arguments.  The shim app calls OpenInputDesktop() and then starts the target process with CreateProcess(), specifying the handle of the I/O desktop.  I have done it; it works well.  In my opinion, the task scheduler should use the I/O desktop when starting a task on a user desktop.

     - Vince

    • Marked as answer by Juke Chou Tuesday, June 5, 2012 10:00 AM
    Friday, May 25, 2012 2:11 PM

All replies

  • Hi,

    I think your purpose may not be achieved, but you can also try to post at http://technet.microsoft.com/en-us/sysinternals/bb469929.aspx for help.


    Juke Chou

    TechNet Community Support


    • Edited by Juke Chou Wednesday, May 23, 2012 9:07 AM
    • Marked as answer by Juke Chou Tuesday, June 5, 2012 10:00 AM
    Wednesday, May 23, 2012 9:06 AM
  • There is a straightforward work-around.  Let the task scheduler run a "shim" app with the real target command line specified in its arguments.  The shim app calls OpenInputDesktop() and then starts the target process with CreateProcess(), specifying the handle of the I/O desktop.  I have done it; it works well.  In my opinion, the task scheduler should use the I/O desktop when starting a task on a user desktop.

     - Vince

    • Marked as answer by Juke Chou Tuesday, June 5, 2012 10:00 AM
    Friday, May 25, 2012 2:11 PM