title: Setting classpath from bat file doesnt work
body: <p>So when i manually start my bat file that is on desktop, it works because executing a bat file via its icon uses directory of the icon(file) which is "C:\Users\Michael\Desktop".</p>
  
  <pre><code>set CLASSPATH = %~dp0 &amp;:: %~dp0 stands for the directory of the bat file
  java InitArray 5 0 4 &amp;:: comment
  pause
  </code></pre>
  
  <p>When i run the bat file above(InitArray.bat) from its desktop icon, it works.</p>
  
  <pre><code>java InitArray 5 0 4 &amp;:: comment
  pause
  </code></pre>
  
  <p>When i run the bat file above(test.bat) from its desktop icon, it works.</p>
  
  <p>But when i run InitArray.bat from task scheduler, it uses the directory "C:\WINDOWS\system32". But that shouldnt be a problem because the first thing the bat file does is "set CLASSPATH = C:\Users\Michael\Desktop\".</p>
  
  <p>Here is the result of task scheduler trying to run InitArray.bat.</p>
  
  <pre><code>C:\WINDOWS\system32&gt;set CLASSPATH = C:\Users\Michael\Desktop\
  
  C:\WINDOWS\system32&gt;java InitArray 5 0 4
  Error: Could not find or load main class InitArray
  
  C:\WINDOWS\system32&gt;pause
  Press any key to continue . . .
  </code></pre>
  
  <p>Now, i know i can fix this issue by adding "C:\Users\Desktop\" to environment variable CLASSPATH. But i shouldnt need to do that since i am manually setting classpath to desktop in the first line of my bat file before trying to run the java class.</p>