title: cmd / powershell: minimize all windows on your desktop except for current command prompt (console) or except for some particular window
body: <p>well, I know how to minimize all open windows on the desktop from a batch file by using powershell method - MinimizeAll(): </p>
  
  <pre><code>powershell -command "&amp; { $x = New-Object -ComObject Shell.Application; $x.minimizeall() }"
  </code></pre>
  
  <p>the problem is: this method minimizes everything including current cmd-console which should be in my case always visible to the user.</p>
  
  <p>now, to workaround this problem I use  external <a href="http://www.nirsoft.net/utils/nircmd.html" rel="nofollow">nircmd.exe</a> tool and this part of my .bat-file looks like this:</p>
  
  <pre><code>:: change current command prompt window title
  title my-cmd-console
  
  :: minimize all open windows on the desktop with powershell command
  powershell -command "&amp; { $x = New-Object -ComObject Shell.Application; $x.minimizeall()  }"
  
  :: bring console back to the front with nircmd.exe command 'win activate [filter window by title]' 
  nircmd.exe win activate title "my-cmd-console" 
  </code></pre>
  
  <p>what I don't like about this code is that there is much 'flashing' on the screen: at start, the console appears on the desktop, then it gets minimized with all other windows and then it's brought back on the desktop front again.  </p>
  
  <p>so, the question is: how to make console appear on the desktop front and 'lock it', so that it never gets out of sight until the command line EXIT is reached.</p>
  
  <p>P.S.
  not sure, but maybe there is an alternative solution to 'minimize all except for particular window' problem without need to use external <a href="http://www.nirsoft.net/utils/nircmd.html" rel="nofollow">nircmd.exe</a> tool. any ideas?</p>