title: Running a Java Application on a Shared Drive from Windows Task Scheduler Client Side
body: <p>First, just wanted to thank everyone in advance for helping with this, let me take you on my journey...</p>
  
  <p><strong>Task:</strong> Run a Java application that is located in a folder on a file server using Windows Task Scheduler, simple enough.</p>
  
  <p>The caveat, is that I would like to utilize the task scheduler option of "Run whether user is logged on or not." and this seems to be a tricky function...</p>
  
  <p><strong>I have set my account as the account that the task is to run under.</strong></p>
  
  <p><strong>What have I tried?</strong></p>
  
  <p><em>Creating a task based on these actions:</em></p>
  
  <p>Java.exe -jar "path to share jar"</p>
  
  <p>Java.exe -jar "path to local jar"</p>
  
  <p>Javaw.exe -jar "path to share jar"</p>
  
  <p>Javaw.exe -jar "path to local jar"</p>
  
  <p>All have had the same result with the "Run whether use is logged on or not." option : 0x1</p>
  
  <p>Next, I tried creating a batch file to run this on my behalf and changed the task to run that batch file and I got all the same results. I have read that utilizing the "Start in (optional)" field of an action may solve the problem, but it did not.</p>
  
  <p>After that, I created a .vbs file with code similar to the following:</p>
  
  <p>Set WshShell = CreateObject("WScript.Shell") </p>
  
  <p>WshShell.Run chr(34) &amp; "C:\Batch Files\syncfiles.bat" &amp; Chr(34), 0</p>
  
  <p>Set WshShell = Nothing</p>
  
  <p>This achieved a 'silent run', but task scheduler still did not run with the "Run whether use is logged on or not.", and ended in 0x1.</p>
  
  <p>All of these work fine with the "Run only when user is logged on." option.</p>
  
  <p>The reason I want to do it whether I am logged on or not, is because I want to run my application before I come in to work.</p>
  
  <p><strong>Update:</strong>
  I've disocvered a few things. In power options for Windows, I had to enable the ability for scheduled tasks  to wake the computer, felt kind of dumb about that one. </p>
  
  <p>Using a simpler task - one that just creates a blank text file - this option works fine. I belive the problem lies with executing Java.</p>