windows 10 cmd prompt change directory to drive on different physical harddrive

I am a Windows noob here (coming from a linux background.) I am having a problem in the cmd prompt changing to a directory on a different drive. Either I haven't found any suitable answers for this particular scenario or I'm not searching with the correct terms. Here is the scenario...

I am on C:\ and I want to change to a directory say E:\specific\directory.

I know about the /E switch for cd, but it's not working in this case. More, I have C:\ and D:\ on an SSD and my E:\ is on an HDD, so they're on two different physical harddrives.

I can do

C:\> cd /D D:\specific\directory with no problem, but trying to

C:\> cd /E E:\specific\directory

I get the error The filename, directory name, or volume label syntax is incorrect.

The only way it lets me on the E:\ drive is with two commands i.e. if I do C:\> e: first, then it lands on the E:\ drive, then with a second cd command I can navigate to whatever directory I want on E:\. So is there any way that I can navigate from C:\ to a specific directory on E:\ in one command rather than two?

Thanks!

5

2 Answers

The /D switch is what you should be using. Per SS64 on CD, CD /D ... changes both drive and directory - regardless of what drive you are attempting to change to - so you would use CD /D E:\Specific\Directory.

As Jeff Zeitlin pointed out, you can use the /D switch however I would highly suggest using Powershell instead of cmd anyway. It is intended to be the replacement for cmd and in it this:

cd E:\specific\directory

Gives the behavior that you want. It also comes with some aliases that sort of "emmulate" *nix commands such as ls to make it a "little" more friendly to people making the transition to a windows shell.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like