title: Jenkins pipeline "cd" command not working, "cd" vs "dir"?
body: <p>I encounter an issue where <code>cd</code> is not working in a Window Node:</p>
  
  <pre><code>node("Window-node") {                       
  
      stage('unstash'){
          echo 'unstash..'
  
          deleteDir()                             
  
          unstash name: uat_stash
          unstash name: prd_stash
  
          bat "cd ${path}"
          bat "mkdir ${params.tag_name}"          
  
      }
  }
  </code></pre>
  
  <p>The problem happen in <code>bat "cd ${path}"</code>, it doesn't really go to the specific path, so the <code>mkdir</code> fails.</p>
  
  <p>The <code>path</code> is somewhere outside of jenkins workspace, while I am using below, it works fine:</p>
  
  <pre><code>dir("${path}") {
      bat "mkdir ${params.tag_name}"
  }
  </code></pre>
  
  <p>I am not too sure why, but I don't prefer to use <code>dir</code> because it will create a temp folder <code>xxx@tmp</code>, but never clean up after Jenkins job finished.</p>
  
  <p>Anyone know why the <code>cd</code> fails? Or, am I able to use <code>dir</code> without creating a Jenkins temp folder?</p>