CD (变更目录命令)

喵喵 发表于 2020-06-28 10:35
浏览次数:
在手机上阅读

CD(变更目录)是一个命令,用于切换MS-DOS和Windows命令行中的目录。

查看英文版

目录

1 CD 运行系统环境

2 CD 语法

3 CD 示例

CD 运行系统环境

Windows 95

Windows 98

Windows xp

Windows vista

Windows 2000

Windows 7

Windows 8

Windows 10

Windows NT

Windows ME

All Versions of MS-DOS

CD 语法

WindowsXP及更高版本的CD语法

CHDIR [/D][驱动器:][路径]

CHDIR [..]

CD [/D][驱动器:][路径]

CD [..]

要更改为父目录的具体指定为. .

CD drive形式: 在指定驱动器中显示当前目录。

输入无参数的 CD 形式以显示当前驱动器和目录。

除了更改驱动器的当前目录外,还可以使用/D开关更改当前驱动器。

如果启用了命令扩展,则CHDIR将更改如下:

当前目录字符串被转换为在磁盘上使用的相同实例。 因此,CD C:\TEMP会将当前目录设置为C:\Temp,如果磁盘上是这样的话。

CHDIR命令不将空格视为分隔符,以CD为子目录名称,该子目录名称包含一个空格而不以引号包围名称。 例如:

chdir \winnt\profiles\username\programs\start menu

和以下相似:

cd "\winnt\profiles\username\programs\start menu"

如果禁用扩展,就必须输入这些内容。

Windows 98及更早的CD语法

CHDIR [驱动器:]路径]

CHDIR [..]

CD [驱动器:][路径]

CD [..]

Windows XP and later syntax

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 set the current directory to C:\Temp if that is the case on disk.

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

chdir \winnt\profiles\username\programs\start menu

is the same as:

cd "\winnt\profiles\username\programs\start menu"

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

Windows 98 and earlier syntax

CHDIR [drive:][path]

CHDIR [..]

CD [drive:][path]

CD [..]

查看英文版

查看中文版

CD 示例

cd\

进入驱动器的最高级别(根)。

cd..

返回一个目录。 例如, 如果您位于C:\windows\命令>目录中,键入上面的命令,它将带您到C:\windows>目录。

提示:

使用Windows 95及更高版本时,当使用两个以上的句点时,可以返回多个目录。 For example, typing例如,输入cd...(三个句点)将返回两个目录(如果可能的话),而不仅仅是一个目录。

cd windows
如果该目录在当前目录中可用,则会将您带入Windows目录。目录名“Windows”可以被任何其他目录名替换,而在MS-DOS和Windows命令行大写化并不重要。

提示:

如果在任何时候需要查看当前目录中有哪些目录可用,请使用dir命令。

cd\windows

如果这个目录可用,它将首先移回驱动器的根目录,然后进入Windows目录。C:\windows目录是默认的安装目录,因此在几乎所有计算机上,这个目录都应该是有效的。

cd\windows\system32

如果该目录可用,它将更改为system 32目录,这是Windows目录的一个子目录。

cd /d e:\pics

例如,如果您在C:驱动器上,则使用/d选项切换到E:驱动器,然后移动到pics目录。

cd
只键入CD即可打印工作目录。例如,如果您在c:\windows>中键入CD,它将打印“c:\windows”。对于熟悉Unix或Linux的用户来说,这可以看作是执行PWD(打印工作目录)命令。
cd\

Goes to the highest level (the root) of the drive.

cd..

Moves back one directory. For example, if you are in the C:\Windows\COMMAND> directory and type the above command it would take you to C:\Windows> directory.

Tip:

With Windows 95 and later, you can go back more than one directory when using more than two periods. For example, typing cd... (three periods) would take you back two directories (if possible) instead of only one directory.

cd windows
If this directory is available in the current directory, it takes you into the Windows directory. The directory name "Windows" can be substituted with any other directory name and in MS-DOS and the Windows command line capitalization is not important.

Tip:

If at any time you need to see what directories are available in the directory you're currently in, use the dir command.

cd\windows

If this directory is available, it would first move back to the root of the drive and then go into the Windows directory. The C:\Windows directory is the default install directory, so on almost all computers this directory should be valid.

cd\windows\system32

If this directory is available, it changes into the system32 directory, a subdirectory of the Windows directory.

cd /d e:\pics

For example, if you were on the C: drive, using the /d option switches to the E: drive and then moves into the pics directory.

cd
Typing cd alone prints the working directory. For example, if you're in c:\windows> and you type the cd it prints "c:\windows." For those users who are familiar with Unix or Linux, this could be thought of as doing the pwd (print working directory) command.

查看英文版

查看中文版

其他命令行

cacls | call | chcp | chdir | ctty | copy | convert | chkdsk | control | compact | chkntfs | choice | comp | command/cmd | cls | cipher | clip | color |

如此好文,分享给朋友