title: How to simulate Windows-D keypress in .bat file
body: <p>I want to write a Windows 7 batch file that will simulate pressing the "Windows Key" + D.</p>
  
  <p>I know that this line of code will close all the open windows :</p>
  
  <pre><code> powershell -command "&amp; { $x = New-Object -ComObject Shell.Application; $x.minimizeall() }"
  </code></pre>
  
  <p>... but sometimes one of the windows has a modal popup and doesn't close.  For example, Putty might be open with a modal message like "the connection to host was lost".</p>
  
  <p>I want to run this batch file, and see the desktop - no matter what.</p>
  
  <p>Any ideas ?</p>
  
  <p>Thanks </p>