-2

I am trying to change directory via

cd d:

Doesn't work. I tried other variations of same process but doesn't work. As if command prompt doesn't recognize D drive.

cmd cd screenshot

phuclv
  • 37,963
  • 15
  • 156
  • 475
edinvnode
  • 3,497
  • 7
  • 30
  • 53
  • You are only changing the active directory on drive d (or you would if you did specify `cd D:\stuff` for example). But you are not switching to that drive. – Marged Dec 08 '15 at 23:01
  • 1
    Possible duplicate of [how to change directory in windows](http://stackoverflow.com/questions/17753986/how-to-change-directory-in-windows) – Marged Dec 08 '15 at 23:02
  • 1
    I would be curious to know the mentioned variations ;-) – Marged Dec 08 '15 at 23:03
  • You can use `cd /d d:\ ` - the `/d` changes the drive. – Wai Ha Lee Dec 08 '15 at 23:40
  • I tried cd D:\ , cd D: , CD D: – edinvnode Dec 08 '15 at 23:43
  • Does this answer your question? [Command prompt won't change directory to another drive](https://stackoverflow.com/questions/11065421/command-prompt-wont-change-directory-to-another-drive) – phuclv Jan 17 '23 at 10:06

2 Answers2

2

just type D:. You don't need to input the cd to change drives.

Marged
  • 10,577
  • 10
  • 57
  • 99
xMetalDetectorx
  • 160
  • 1
  • 14
1

The short answer

The correct way to go from a random place on your C: drive to the root of your D: drive, is the following command :

cd /d d:\

More details

If you're somewhere random on your D:\ drive, and you want to go to the root of your drive, you can use this command :

cd d:\

If you're somewhere random on your D:\ drive, and you want to go to a specific folder on your drive, you can use this command :

cd d:\path\to\my\folder

If you're on a different drive, and you want to go to the root of your D:\ drive, you can use this command :

cd /d d:\

If you're on a different drive, and you want to go to a specific folder on your D: drive, you can use this command :

cd /d d:\path\to\my\folder

If you're on a different drive, and you want to go to the last open folder of you D: drive, you can use this command :

cd /d d:

As a shorthand for cd /d d:, you can also use this command :

d:
Community
  • 1
  • 1
John Slegers
  • 45,213
  • 22
  • 199
  • 169
  • 1
    An addition: The command ``cd \`` can be used to change to root of current drive independent on drive letter. And the command `cd \path\to\my\folder` can be used to change current directory to a specific directory on current drive independent on drive letter relative to root directory. A path starting with ``\`` is relative to root of current drive. A path starting with ``..\`` references parent directory of current directory. And a path starting with and ``.\`` or none of those 3 strings is relative to current directory. – Mofi Jul 08 '17 at 21:09