命令提示符不会更改目录 [英] Command Prompt Won't Change Directory
问题描述
我正在尝试编译一些java(目前正在学习java),为此我需要更改命令提示符的目录(使用javac)。
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?
推荐答案
As @nasreddine 回答,或者您可以使用 / d
As @nasreddine answered or you can use /d
cd /d d:\Docs\Java
有关 cd
命令使用:
C:\Documents and Settings\kenny>help cd
显示当前目录的名称或更改当前目录。
Displays the name of or changes the current directory.
CHDIR [/ D] [drive:] [path]
CHDIR [..]
CD [/ D] [drive:] [path]
CD [..]
CHDIR [/D] [drive:][path] CHDIR [..] CD [/D] [drive:][path] CD [..]
..指定要更改为父目录。
.. Specifies that you want to change to the parent directory.
键入CD驱动器:在指定的驱动器中显示当前目录。
键入CD,无参数显示当前驱动器和目录。
Type CD drive: to display the current directory in the specified drive. Type CD without parameters to display the current drive and directory.
除了更改当前
目录之外,还可以使用/ D开关更改当前驱动器一个驱动器。
Use the /D switch to change current drive in addition to changing current directory for a drive.
如果启用了命令扩展名CHDIR更改如下:
If Command Extensions are enabled CHDIR changes as follows:
当前目录字符串被转换在
上使用与磁盘名称相同的大小写。所以CD C:\TEMP实际上会将当前的
目录设置为C:\Temp,如果是磁盘上的情况。
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命令不将空格视为分隔符,因此可以将
CD转换为包含空格的子目录名称,而不包含
带有引号的名称。例如:
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 \winnt\profiles\username\programs\start菜单
cd \winnt\profiles\username\programs\start menu
与以下相同:
cd\winnt\profiles\username\programs\start菜单
cd "\winnt\profiles\username\programs\start menu"
如果扩展程序被禁用,那么您将如何输入。
which is what you would have to type if extensions were disabled.
这篇关于命令提示符不会更改目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!