#author("2019-03-02T05:16:47+00:00","default:haikikyou","haikikyou")
#author("2019-03-17T10:54:38+00:00","default:haikikyou","haikikyou")
[[Windows/コマンドプロンプト/コマンド]]

#contents


* 内容 [#vc5017c3]

- ディレクトリを作成する。
- 再帰的にディレクトリを作成できる。
ファイルおよびディレクトリを移動または名前を変更する。

* 使用方法 [#h0ff930c]

#geshi(bash){{{
md [<Drive>:]<Path>
mkdir [<Drive>:]<Path>
move [{/y | /-y}] [<Source>] [<Target>]
}}}

** オプション [#o459c385]

|オプション|説明|h
|/y|上書き前に確認メッセージを表示する|
|/-y|上書き前に確認メッセージを表示しない|

* 使用例 [#j5379a67]

** ディレクトリを作成する [#w30c2a2b]
** ファイルを別ファイルに移動する [#v557e2fc]
#geshi(dos){{{
c:\test\del_test>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 7241-A2C2 です

 c:\test\del_test のディレクトリ

2019/03/17  19:50    <DIR>          .
2019/03/17  19:50    <DIR>          ..
2019/03/06  23:35    <DIR>          b
2019/03/17  19:49                 0 file.txt
2019/03/17  19:50                 0 file2.txt
               2 個のファイル                   0 バイト
               3 個のディレクトリ  34,416,959,488 バイトの空き領域

c:\test\del_test>move file.txt file2.txt
c:\test\del_test\file2.txt を上書きしますか? (Yes/No/All): Yes
        1 個のファイルを移動しました。

}}}

** ファイルをディレクトリに移動する [#t49aca46]

#geshi(dos){{{
C:\Users\Administrator\dos>md parent\child

C:\Users\Administrator\dos>dir /s parent
c:\test\docs>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 0A12-47B4 です
 ボリューム シリアル番号は 7241-A2C2 です

 C:\Users\Administrator\dos\parent のディレクトリ
 c:\test\docs のディレクトリ

2019/03/02  14:12    <DIR>          .
2019/03/02  14:12    <DIR>          ..
2019/03/02  14:12    <DIR>          child
               0 個のファイル                   0 バイト
2019/03/17  19:52    <DIR>          .
2019/03/17  19:52    <DIR>          ..
2019/03/17  19:52    <DIR>          downloads
2019/03/17  19:52                 6 file.txt
2019/03/17  19:52    <DIR>          pictures
               1 個のファイル                   6 バイト
               4 個のディレクトリ  34,416,689,152 バイトの空き領域

 C:\Users\Administrator\dos\parent\child のディレクトリ
c:\test\docs>move file.txt downloads
        1 個のファイルを移動しました。

2019/03/02  14:12    <DIR>          .
2019/03/02  14:12    <DIR>          ..
c:\test\docs>tree /f downloads
フォルダー パスの一覧
ボリューム シリアル番号は 7241-A2C2 です
C:\TEST\DOCS\DOWNLOADS
    file.txt

サブフォルダーは存在しません


}}}

** ディレクトリ名を変更する [#m3526b33]


#geshi(dos){{{
 c:\test\del_test のディレクトリ

2019/03/06  23:33    <DIR>          .
2019/03/06  23:33    <DIR>          ..
2019/03/06  23:35    <DIR>          a
               0 個のファイル                   0 バイト
               3 個のディレクトリ  34,417,090,560 バイトの空き領域

     ファイルの総数:
c:\test\del_test>move a b
        1 個のディレクトリを移動しました。

c:\test\del_test>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 7241-A2C2 です

 c:\test\del_test のディレクトリ

2019/03/17  19:49    <DIR>          .
2019/03/17  19:49    <DIR>          ..
2019/03/06  23:35    <DIR>          b
               0 個のファイル                   0 バイト
               5 個のディレクトリ  296,915,824,640 バイトの空き領域
               3 個のディレクトリ  34,417,090,560 バイトの空き領域

}}}

* 参考リンク [#n9d5d412]

- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/md
- https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/move



トップ   一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
目次
ダブルクリックで閉じるTOP | 閉じる
GO TO TOP