title: How to change to temp directory in PowerShell?
body: <p>In PowerShell I can echo the value of <code>%TEMP%</code> using the command <code>$Env:TEMP</code>. Here is the output on my machine:</p>
  
  <pre><code>PS&gt; $Env:temp
  C:\Users\IAIN~1.COR\AppData\Local\Temp
  </code></pre>
  
  <p>When I try to change to the directory using the <code>cd</code> command, I receive this error:</p>
  
  <pre><code>PS&gt; cd $Env:temp
  Set-Location : An object at the specified path C:\Users\IAIN~1.COR does not exist.
  At line:1 char:3
  + cd &lt;&lt;&lt;&lt;  $Env:temp
      + CategoryInfo          : InvalidArgument: (:) [Set-Location], PSArgumentException
      + FullyQualifiedErrorId : Argument,Microsoft.PowerShell.Commands.SetLocationCommand
  </code></pre>
  
  <p>I suspect that PowerShell is interpreting the 8.3 file name literally. The long file name of the directory is <code>C:\Users\iain.CORP\AppData\Local\Temp</code>. When I try <code>cd C:\Users\Iain.CORP\AppData\Local\Temp</code>, the directory changes successfully.</p>
  
  <p>How can I open the path in <code>$Env:TEMP</code> using PowerShell? Do I have to have the long file name first?</p>