25

I read this answer but it doesn't work for Windows PowerShell. How to change the drive?

EDIT:
Please ignore this question. I was trying to change the drive from C: to D:. The reason it wasn't working was that there was no D: on my computer. A really silly mistake.

Aseem Bansal
  • 413
  • 1
  • 6
  • 15
  • possible duplicate of [Using cd Command in Windows Command Line, Can't Navigate to D:∖](http://superuser.com/questions/135214/using-cd-command-in-windows-command-line-cant-navigate-to-d) – Excellll Jun 23 '13 at 00:52
  • 1
    @Excellll It's not, the question you linked to talks about the native shell (cmd), not PowerShell. – Ohad Schneider Feb 15 '16 at 14:17
  • BTW, You should save as a *.ps1 file to run in PowerShell... i.e. Set-Location C:\Folder – CZahrobsky Aug 30 '16 at 21:34

2 Answers2

47

PowerShell will resolve full paths just fine with CD.

Where in DOS you have to /d for drive changing:

cd /d H:\Folder

PowerShell you can just type the full path:

cd H:\Folder
Austin T French
  • 10,505
  • 27
  • 42
-1

It’s the same as the DOS shell “cd dir

Ben Lavender
  • 599
  • 2
  • 8