title: Create scheduled task with administrative rights running from normal user account
body: <p>I am creating an scheduled task during installation of an application. The installer itself is running with administrator permissons:</p>
  
  <pre><code>SchTasks /F /create /tn "MyApp Start" /XML "D:\MyApps\start.xml" /ru "System"
  </code></pre>
  
  <p>This task is intended to start during system startup, which is working fine as long as the user who is logging in is the one who created the task.</p>
  
  <p>In my special case the task should also run if another non-admin-user is logging in.</p>
  
  <p>Currently the task is not running, if the non-admin-user is logging in. Even more, the task ist not visible to him at all.</p>
  
  <p>The question is: How can I create a scheduled task as administrator</p>
  
  <ul>
  <li>using DOS or PowerShell-comnmands</li>
  <li>that runs with System priviliges</li>
  <li>that starts even if a normal non-admin-user logs into Windows 7/8</li>
  </ul>
  
  <p>Here is my xml-description of the task.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt;
    &lt;RegistrationInfo&gt;
      &lt;Date&gt;2015-03-02T22:54:11&lt;/Date&gt;
      &lt;Author&gt;foobar&lt;/Author&gt;
    &lt;/RegistrationInfo&gt;
    &lt;Triggers&gt;
      &lt;BootTrigger&gt;
        &lt;StartBoundary&gt;2015-03-02T22:54:11&lt;/StartBoundary&gt;
        &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;/BootTrigger&gt;
    &lt;/Triggers&gt;
    &lt;Principals&gt;
      &lt;Principal&gt;
        &lt;UserId&gt;S-1-5-18&lt;/UserId&gt;
        &lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt;
      &lt;/Principal&gt;
    &lt;/Principals&gt;
    &lt;Settings&gt;
      &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt;
      &lt;DisallowStartIfOnBatteries&gt;false&lt;/DisallowStartIfOnBatteries&gt;
      &lt;StopIfGoingOnBatteries&gt;false&lt;/StopIfGoingOnBatteries&gt;
      &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt;
      &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt;
      &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt;
      &lt;IdleSettings&gt;
        &lt;Duration&gt;PT10M&lt;/Duration&gt;
        &lt;WaitTimeout&gt;PT1H&lt;/WaitTimeout&gt;
        &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt;
        &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt;
      &lt;/IdleSettings&gt;
      &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt;
      &lt;Enabled&gt;true&lt;/Enabled&gt;
      &lt;Hidden&gt;false&lt;/Hidden&gt;
      &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt;
      &lt;WakeToRun&gt;false&lt;/WakeToRun&gt;
      &lt;ExecutionTimeLimit&gt;PT72H&lt;/ExecutionTimeLimit&gt;
      &lt;Priority&gt;7&lt;/Priority&gt;
    &lt;/Settings&gt;
    &lt;Actions&gt;
      &lt;Exec&gt;
        &lt;Command&gt;D:\MyApps\start.bat&lt;/Command&gt;
      &lt;/Exec&gt;
    &lt;/Actions&gt;
  &lt;/Task&gt;
  </code></pre>
  
  <p>Do you have any suggestions?</p>
  
  <p>Best Regards
  Tobias</p>