LoginSignup
34
31

More than 5 years have passed since last update.

【インストール不要】コマンドプロンプトで再帰的にファイル一覧を得る方法あれこれ

Last updated at Posted at 2015-04-02

ディレクトリとファイルの一覧を得る

DIR /S /B
C:\temp>DIR /S /B
C:\temp\dir
C:\temp\メモ.txt
C:\temp\メモ2.txt
C:\temp\dir\fuga.txt
C:\temp\dir\hoge..txt
C:\temp\dir\nestdir
C:\temp\dir\nestdir2
C:\temp\dir\nestdir\test.jpg
C:\temp\dir\nestdir2\foo.bmp
C:\temp\dir\nestdir2\piyo.txt

ディレクトリのみの一覧

DIR /S /B /AD
C:\temp>DIR /S /B /AD
C:\temp\dir
C:\temp\dir\nestdir
C:\temp\dir\nestdir2

ファイルのみの一覧

DIR /S /B /A-D
C:\temp>DIR /S /B /A-D
C:\temp\メモ.txt
C:\temp\メモ2.txt
C:\temp\dir\fuga.txt
C:\temp\dir\hoge..txt
C:\temp\dir\nestdir\test.jpg
C:\temp\dir\nestdir2\foo.bmp
C:\temp\dir\nestdir2\piyo.txt

ツリー形式(ディレクトリのみ)

TREE
C:\temp>TREE
フォルダー パスの一覧
ボリューム シリアル番号は 9E00-704F です
C:.
└─dir
    ├─nestdir
    └─nestdir2

ツリー形式(ファイルを含む)

TREE /F
C:\temp>TREE /F
フォルダー パスの一覧
ボリューム シリアル番号は 9E00-704F です
C:.
│  メモ.txt
│  メモ2.txt
│
└─dir
    │  fuga.txt
    │  hoge..txt
    │
    ├─nestdir
    │      test.jpg
    │
    └─nestdir2
            foo.bmp
            piyo.txt
34
31
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
34
31