O'Reilly logo

Pro Windows PowerShell by Hristo Deshev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.3. Navigating to Drives

You might have been wondering, from the examples you have seen so far, how we could use the cd command to switch to a new current drive. If you are an experienced cmd.exe user, you would not expect that to work—the cd command can only change to new directories on the current drive. Here is how that works when running cmd.exe:

C:\>cd d:\

C:\>

As you can see, the current drive remains set to C:. If you dig deeper, you will notice that cmd.exe keeps a "current" folder for every drive that it knows about. We can set the current folder to a drive other than the current one, and it will be available once we switch to that drive. For example, if we are currently in the C:\ location and cd to D:\tmp, we will change the current ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required