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

#contents


* 内容 [#oe62267c]

- ディレクトリを作成する。
- 再帰的にディレクトリを作成できる。
ファイルの名前を変更する。複数ファイルも可能。

* 使用方法 [#v6a45ae7]

#geshi(bash){{{
md [<Drive>:]<Path>
mkdir [<Drive>:]<Path>
ren [<Drive>:][<Path>]<FileName1> <FileName2>
rename [<Drive>:][<Path>]<FileName1> <FileName2>
}}}

** オプション [#gcd4d148]

|オプション|説明|h
|FileName1|元のファイル名|
|FileName2|新しいファイル名|

* 使用例 [#u8ba97e5]

** ディレクトリを作成する [#t1b59cda]
** 拡張子を一式変える [#e913fa1c]


#geshi(dos){{{
C:\Users\Administrator\dos>md parent\child
c:\test\docs>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 7241-A2C2 です

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

2019/03/17  20:51    <DIR>          .
2019/03/17  20:51    <DIR>          ..
2019/03/17  20:51                 6 bar.txt
2019/03/17  19:52    <DIR>          downloads
2019/03/17  20:51                 5 foo.txt
2019/03/17  20:51                 8 hello.txt
2019/03/17  19:52    <DIR>          pictures
               3 個のファイル                  19 バイト
               4 個のディレクトリ  34,412,707,840 バイトの空き領域

c:\test\docs>rename *.txt *.out

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  20:52    <DIR>          .
2019/03/17  20:52    <DIR>          ..
2019/03/17  20:51                 6 bar.out
2019/03/17  19:52    <DIR>          downloads
2019/03/17  20:51                 5 foo.out
2019/03/17  20:51                 8 hello.out
2019/03/17  19:52    <DIR>          pictures
               3 個のファイル                  19 バイト
               4 個のディレクトリ  34,412,707,840 バイトの空き領域

 C:\Users\Administrator\dos\parent\child のディレクトリ
}}}

2019/03/02  14:12    <DIR>          .
2019/03/02  14:12    <DIR>          ..
               0 個のファイル                   0 バイト
** ディレクトリ名を変更する [#v63c55dc]

     ファイルの総数:
               0 個のファイル                   0 バイト
               5 個のディレクトリ  296,915,824,640 バイトの空き領域
#geshi(dos){{{
c:\test\docs>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 7241-A2C2 です

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

2019/03/17  20:52    <DIR>          .
2019/03/17  20:52    <DIR>          ..
2019/03/17  20:51                 6 bar.out
2019/03/17  19:52    <DIR>          downloads
2019/03/17  20:51                 5 foo.out
2019/03/17  20:51                 8 hello.out
2019/03/17  19:52    <DIR>          pictures
               3 個のファイル                  19 バイト
               4 個のディレクトリ  34,412,707,840 バイトの空き領域

c:\test\docs>rename downloads download

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

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

2019/03/17  20:52    <DIR>          .
2019/03/17  20:52    <DIR>          ..
2019/03/17  20:51                 6 bar.out
2019/03/17  19:52    <DIR>          download
2019/03/17  20:51                 5 foo.out
2019/03/17  20:51                 8 hello.out
2019/03/17  19:52    <DIR>          pictures
               3 個のファイル                  19 バイト
               4 個のディレクトリ  34,412,642,304 バイトの空き領域

}}}

* 参考リンク [#led0bb9a]

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



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