Command prompt won't change directory to anoth

2019-01-16 00:08发布

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

C:\...\Admin> cd D:\Docs\Java
C:\...\Admin> cd
C:\...\Admin

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

C:\...\Admin> cd "D:\Docs\Java"
C:\...\Admin>

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

9条回答
干净又极端
2楼-- · 2019-01-16 00:28

If you want to change from current working directory to another directory then in the command prompt you need to type the name of the drive you need to change to, followed by : symbol. example: assume that you want to change to D-drive and you are in C-drive currently, then type D: and hit Enter.

On the other hand if you wish to change directory within same working directory then use cd(change directory) command followed by directory name. example: assuming you wish to change to new folder then type: cd "new folder" and hit enter.

Tips to use CMD: Windows command line are not case sensitive. When working with a file or directory with a space, surround it in quotes. For example, My Documents would be "My Documents". When a file or directory is deleted in the command line, it is not moved into the Recycle bin. If you need help with any of command type /? after the command. For example, dir /? would give the options available for the dir command.

查看更多
虎瘦雄心在
3楼-- · 2019-01-16 00:28

you should use a /d before path as below :

cd /d e:\
查看更多
地球回转人心会变
4楼-- · 2019-01-16 00:31

Use drive letter d for changing to D drive like:

  C:\> d:

When changing drives, you just need to type the drive letter, like d: (don't use the backslash, like d:\; it doesn't work).

You only use cd when moving between directories within the same drive.

查看更多
别忘想泡老子
5楼-- · 2019-01-16 00:39

you can use help on command prompt on cd command by writing this command cd /? as shown in this figure enter image description here

查看更多
走好不送
6楼-- · 2019-01-16 00:43

The directory you're switching to is on another drive, you need to switch to that drive using :

C:\...\Admin> d:

then you can cd into the directory you want.

C:\...\Admin> d:
D:\>cd "Docs\Java"

D:\Docs\Java>
查看更多
霸刀☆藐视天下
7楼-- · 2019-01-16 00:43

I suppose you are using Windows system.

Once you open CMD you would be shown with the default location i.e. like this

C:\Users\Admin - In your case its admin as mentioned else it will be the username of your computer

Consider if you want to move to E directory then simply type E:

This will move the user to E: Directory. Now change to what ever folder you want to point to in E: Drive

Ex: If you want to move to Software directory of E folder then first type

E:

then type the location of the folder

cd E:\Software

Viola

查看更多
登录 后发表回答