title: MS-Win-CMD PushD/PopD how it work and why not in a "For /f"-Loop
body: <p>After I faild again and again to find the answer I wrote these Script:</p>
  
  <pre><code>&lt;!-- : first Line of "JustPopdBack.cmd"-Script (a CMD+Script for Windows)
  @echo off %debug%
  setLocal enableExtensions
  
  ::    Copyleft 2017 Markus Merkle (aka Mäx) - Licence: GNU-GPLv3
  ::  ----------------------------------------------------------------------------
  ::  Cause it seems stupid to make a short Script long just for Right
  ::  of the Author, so the Licence-Text is not embeded in this Script.
  ::  !!! Please have a look on &lt;http://www.gnu.org/licenses/&gt;
  ::      if you still don't know the GNU-GPLv3.
  ::  ----------------------------------------------------------------------------
  ::   This is just a free and open TestScript
  ::   Feel free to used or modify but please mark this work (how as done).
  :: -----------------------------------------------------------------------------
   title JustPopdBack-Test
   color 0a                                 %= cause I like LightGreen on Black =%
   echo.
   echo. Just a Test-Script for PushD and PopD Command
   echo.
   echo. To use it please Enter some Directorys first
   echo. Don't shy to use diffrent Drives (C:\ or D:\ etc. )
   echo. ...and feel free to use the TAB-Key then...
   echo. Lets PushD in this Dir and after just Enter Nothing Popd out.
  ::******************************************************************************
   :dLoop for UserQuest and Pushd in
   echo.
   set "NxtDir="
   set /P "NxtDir=NextDir? :\&gt; "
   if defined NxtDir (PushD %NxtDir% &amp; goTo dLoop)
  ::------------------------------------------------------------------------------
   echo.
   echo. Lets see the PushD History
   pushD
   echo. now try again with "For /F"-Loop a PopD Back.
   for /f %%a in ('pushD') do (echo %%a &amp;&amp; PopD)
   echo.
   echo This don't work - did you know why?
   timeOut -1
  :*******************************************************************************
   :PopDback that will work
   PopD &amp;&amp; Echo. Uh I PopD'd - let's'ee PushD now: &amp;&amp; PushD &amp;&amp; goTo PopDback
   :: but I don't like that - can you help to make me happy ?
   --------------------------------------------------------------------------------
   timeout -1
   color
   exit /b                                        %= That the End of this Script =%
   ::       Thnx to all my Teachers 
   ::    ...but the realy ones not the called &amp; most have just 60 Minutes for me...
  </code></pre>
  
  <p>I hope you see why I wrote this Script and also hope all you like to give me many comments so we can find out what is going wrong here and maybe there ...
  (hey not in my Head - I hope :-)</p>
  
  <p>My Targed of this Post is a Working of</p>
  
  <pre><code>for /f %a in ('PushD') do PopD
  </code></pre>