title: Setting a .bat file to run at windows shutdown doesn't work
body: <p>I need to run a Java application at windows shutdown. I have Windows 7 and I have tried to do this in 2 ways: </p>
  
  <ol>
  <li><p>I have created a .bat file containing the following:</p>
  
  <pre><code>javaw -Xmx200m -jar C:\path\to\jar\dl.jar
  </code></pre>
  
  <p>dl.jar is the application I need to run at shutdown and I added in <code>Local Group Policies-&gt;Windows Settings-&gt;Scripts(Stratup/Shutdown)-&gt;Shutdown-&gt;Script Name</code> my batch file, but it doesn't work.</p></li>
  <li><p>Also I have added in Shutdown Scripts from Local Group Policies at Script Name: <code>C:\Windows\System32\cmd.exe</code> and at Script Parameters the path to my batch file, it doesn't work in this way either</p></li>
  </ol>
  
  <p>If I run the .bat file from command promt it works. Does anyone have any idea how to make this work?</p>