Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 views
in Technique[技术] by (71.8m points)

cmd - Command prompt won't change directory to another drive

I'm trying to compile some java (learning java currently), and to do so I need to change command-prompt's directory.

C:...Admin> cd D:DocsJava
C:...Admin> cd
C:...Admin

It doesn't change the directory. I try again using quotes:

C:...Admin> cd "D:DocsJava"
C:...Admin>

Again it doesn't change the directory. What am I doing wrong?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

As @nasreddine answered or you can use /d

cd /d d:DocsJava

For more help on the cd command use:

C:Documents and Settingskenny>help cd

Displays the name of or changes the current directory.

CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..]

.. Specifies that you want to change to the parent directory.

Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory.

Use the /D switch to change current drive in addition to changing current directory for a drive.

If Command Extensions are enabled CHDIR changes as follows:

The current directory string is converted to use the same case as the on disk names. So CD C:TEMP would actually set the current directory to C:Temp if that is the case on disk.

CHDIR command does not treat spaces as delimiters, so it is possible to CD into a subdirectory name that contains a space without surrounding the name with quotes. For example:

cd winntprofilesusernameprogramsstart menu

is the same as:

cd "winntprofilesusernameprogramsstart menu"

which is what you would have to type if extensions were disabled.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...