title: Batch File runs manually but not in task scheduler
body: <p>I have a batch file, which will search for a java process and kill the same.
  The script works fine when the bat file is run on the command prompt. But when I tried to execute in task scheduler, it is not working.</p>
  
  <p>I have selected the option "Run whether the user is logged in or not"</p>
  
  <p>My batch file is as given below:</p>
  
  <pre><code>for /F "tokens=1*" %%i in ('jps -lv^|C:\Windows\System32\find.exe "TaskTest"') do (C:\Windows\System32\taskkill.exe /F /PID %%i )
  </code></pre>
  
  <p>I have also tried whatever is mentioned in this link
  <a href="https://stackoverflow.com/questions/12513264/batch-runs-manually-but-not-in-scheduled-task">Batch runs manually but not in scheduled task</a></p>
  
  <p>Any other suggestions please.</p>
  
  <p>Note: I have another batch file to archive files which runs properly in task scheduler with the same user account</p>