chdir

カレントディレクトリを別のドライブに変更して表示


chdir

  • help chdir

Output:

現在のディレクトリを変更したり、ディレクトリ名を変更したりします。

CHDIR [/D] [ドライブ:][パス]
CHDIR [..]
CD [/D] [ドライブ:][パス]
CD [..]

  ..   親ディレクトリに変更するときに指定します。

CD ドライブ: と入力すると指定されたドライブの現在のディレクトリが表示
されます。パラメーターを指定しないで CD と入力すると、現在のドライブと
ディレクトリが表示されます。

現在のディレクトリだけでなく、現在のドライブも変更するには /D オプショ
ンを使用してください。

コマンド拡張機能を有効にすると、CHDIR は次のように変更されます:

現在のディレクトリの文字列に入力された大文字と小文字は、ディスク上の名前
と同じになるように変換されます。たとえば、ディスク上のディレクトリ名が
Temp である場合、CD C:\TEMP と入力すると、現在のディレクトリは C:\Temp に設定されます。

CHDIR コマンドは空白を区切り文字として扱わなくなるため、空白文字を
含むサブディレクトリ名を引用符で囲まなくても、CD を実行して
にそのサブディレクトリに移動できるようになります。たとえば、

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

は、次と同じです:

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

拡張機能が無効である場合は、こちらを入力します。
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 \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.

Return Code: 1


example

カレントディレクトリを別のドライブに変更して表示


c:\example>subst a: c:\Windows

c:\example>cd a:\System32

c:\example>cd /d a:\System32

a:\System32>cd
a:\System32

最終更新 Oct 01, 2022 08:49 UTC
Built with Hugo
テーマ StackJimmy によって設計されています。