-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

5
  • 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. Commented Dec 8, 2015 at 23:01
  • 1
    I would be curious to know the mentioned variations ;-) Commented Dec 8, 2015 at 23:03
  • You can use cd /d d:\ - the /d changes the drive. Commented Dec 8, 2015 at 23:40
  • I tried cd D:\ , cd D: , CD D: Commented Dec 8, 2015 at 23:43
  • 4
    Does this answer your question? Command prompt won't change directory to another drive Commented Jan 17, 2023 at 10:06

2 Answers 2

2

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

Sign up to request clarification or add additional context in comments.

Comments

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:

1 Comment

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.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.