title: cd command does not changed to variable value change directories
body: <p>Here the value is coming correct in the variable lastoccur and also it is echoed</p>
  
  <p>but the cd command to move to that directory does is seemingly not working. Why is this happening?</p>
  
  <pre><code>@echo off
  mode con: cols=157 lines=2500
  setlocal enabledelayedexpansion
  
  for /f "tokens=2" %%G in ('p4 client -o 2850NewDev ^| findstr /c:"Root:"') do (
      set lastoccur=%%G
  )
  
  cd /d !lastoccur!
  echo !lastoccur!
  PAUSE
  </code></pre>
  
  <p><strong>UPDATE 1</strong></p>
  
  <p>I changed the code to this:</p>
  
  <pre><code>@echo off
  mode con: cols=157 lines=2500
  set lastoccur=""
  
  for /f "tokens=2" %%G in ('p4 client -o 2850NewDev ^| findstr /c:"Root:"') do (
      set lastoccur=%%G
  )
  
  cd %lastoccur%
  echo %lastoccur%
  PAUSE
  </code></pre>
  
  <p>Now also cd does not change the directory. I am not seeing any path on the window, just the echoed value.</p>