title: Task scheduler cannot open batch file when set to run whether user is logged on or not
body: <p>OS: Windows Server 2008 R2 Enterprise</p>
  
  <p>I am unable to get the Task Scheduler to run .bat files while I am logged off. I have a a production .bat file I want to use, but for my troubleshooting purposes I am using C:\Users\Administrator\Desktop\test.bat</p>
  
  <p>test.bat is very simple. All it contains is:
  taskkill /im notepad.exe</p>
  
  <p>It runs successfully on its own. If I have Notepad open and I double-click test.bat then the cmd window flashes and Notepad dies. The .bat file is not the problem.</p>
  
  <p>The task I created in Task Scheduler is "Test taskkill" (without the quotes). I can see its location in Windows Explorer: C:\Windows\System32\Tasks\Test taskkill</p>
  
  <p>If the task is set to run only when the user is logged on then the task works. With this setting, I can right-click on it > run and I get the same behavior as if I double-click the .bat file. That means the task is configured correctly.</p>
  
  <p>If I set it to run whether or not the user is logged on then when I right-click > run nothing obvious happens. The job is reported as having been run successfully in the history, but Notepad survives. I know that I am using the proper credentials for the account that I am configuring to run the task. That account is the local administrator.</p>
  
  <p>This issue appears similar to issues other have had in the past:</p>
  
  <p><a href="https://stackoverflow.com/questions/7239560/problem-running-a-bat-file-in-scheduled-task">Running a .bat file in Scheduled Task</a></p>
  
  <p><a href="http://social.technet.microsoft.com/Forums/windowsserver/en-US/d47d116e-10b9-44f0-9a30-7406c86c2fbe/scheduled-task-wont-run-bat-file?forum=winservermanager" rel="noreferrer">http://social.technet.microsoft.com/Forums/windowsserver/en-US/d47d116e-10b9-44f0-9a30-7406c86c2fbe/scheduled-task-wont-run-bat-file?forum=winservermanager</a></p>
  
  <p>The thread in the second link seemed to resolve an identical issue for many people with the suggestion that the account used to run the task requires explicit permission to the .bat file and all files that the .bat file modifies. This was very promising (if an annoying requirement). However, I have confirmed or assigned explicit permissions for the local administrator to the following areas, and I am still not successful:</p>
  
  <ul>
  <li>C:\Users\Administrator\Desktop\</li>
  <li>C:\Users\Administrator\Desktop\test.bat</li>
  <li>C:\Windows\System32\Tasks\</li>
  <li>C:\Windows\System32\Tasks\Test taskkill</li>
  </ul>
  
  <p>Additionally, I have confirmed that the local administrator account is in the local administrators group.</p>
  
  <p>Am I missing some other permissions that needs to be set? Is there something else I should be looking at? Thanks!</p>