title: Running visible applications, using Java ProcessBuilder, from a process started by TaskScheduler
body: <p>It's well known that when starting tasks via TaskScheduler in recent versions of Windows, that if the task is "run whether user is logged on or not", then the task will not run interactively - i.e. it will not start a UI.</p>
  
  <p>For reference, this is according to <a href="https://technet.microsoft.com/en-us/library/cc722152.aspx" rel="noreferrer">Microsoft</a>, and has been highlighted in this <a href="https://superuser.com/questions/78359/why-is-windows-7-scheduled-task-running-hiddenhttp://">SuperUser question</a> and this <a href="https://stackoverflow.com/questions/39736810/task-scheduler-cant-show-gui-of-the-application-after-logout-and-login-run-whehttp://">StackOverflow question</a>:</p>
  
  <blockquote>
    <p>You can specify that a task should run even if the account under which the task is scheduled to run is not logged on when the task is triggered. To do this, select the radio button labeled Run whether user is logged on or not . If this radio button is selected, tasks will not run interactively. To make a task run interactively, select the Run only when user is logged on radio button.</p>
  </blockquote>
  
  <p>However, my problem is derivative of this.</p>
  
  <ul>
  <li><p>The task started by TaskScheduler is a Java client application which
  can be instructed to run processes - these are run via ProcessBuilder
  in the client application. As such, it is okay that this client
  application is hidden / does not start a UI - indeed, there is no UI.</p></li>
  <li><p>However, if the client application is started via TaskScheduler to 'run whether user is logged on or not' as above, then any processes that are started by ProcessBuilder in the client application are also unable to run interactively / unable to show a UI. This is a problem, as some of the processes started by the client are UI applications.</p></li>
  </ul>
  
  <p>I'm not sure why this would be the case, but really I'm trying to work out if there is a work around - e.g. some environment variables or properties that could be added to get a visible process started by the (invisible) client.</p>
  
  <p>Any thoughts?</p>