Can't change current working directory to external drive in Windows

9

5

Possible Duplicate:
Using cd Command in Windows Command Line, Can’t Navigate to D:\
CMD cd to other drives except C:\ not working

I'm trying to run a program located on an external USB disk using the Windows command prompt. I'm running Windows 7 64-bit (running in VMWare Workstation 8.0.)

Here's what happens:

  1. I plug in the USB disk and it appears as drive letter 'E' in My Computer.
  2. I launch cmd from the start menu.
  3. I notice the prompt displays C:\Users\Tom>
  4. I type cd E:\
  5. I notice the prompt displays C:\Users\Tom> (cd also yields C:\Users\Tom>)

I can explore the drive using explorer.exe just fine, and it is connected according to VMWare Workstation. What am I doing wrong?

Tom

Posted 2012-06-25T21:02:54.000

Reputation: 283

Question was closed 2012-12-01T01:40:18.540

Answers

23

When you type cd e:\ you are changing the current working directory (CWD) for drive E:, but you are not currently on that drive. To go to drive E:, just type: E: and hit enter.

You can change the CWD of any drive without being on it, as you can change drives at anytime by just typing the drive letter followed by colon (:).

This is expected behavior since the very first versions of MS-DOS (and probably all other DOS OS), as for Windows as it's successor.

0xAF

Posted 2012-06-25T21:02:54.000

Reputation: 659

1If you were to type cd e:\foo while still on the C drive, then typed e: you would find that the folder would change not to e:\> but to e:\foo> May seem silly, but it can be useful when you need to copy several things to a long DOS path. Change the path, then you can just type copy bar.txt e: and it will go to the path you specified, rather than the root of e: and without having to re-specify the path. – techturtle – 2012-06-25T21:23:12.947

Yes, that's the whole point of changing the CWD of different drive ;) – 0xAF – 2012-06-25T21:26:14.167

5

To change to a different drive and simultaneously specify a directory in that drive you can use the "/d"-parameter like this: cd /d E:\ This will take you to the root directory of E:

Terje Mikal

Posted 2012-06-25T21:02:54.000

Reputation: 4 867