Batch-script-dir

提供:Dev Guides
2020年6月23日 (火) 09:41時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

バッチスクリプト-DIR

このバッチコマンドは、ディレクトリの内容を一覧表示します。

構文

dir

次の例は、 dir コマンドのさまざまなバリエーションを示しています。

@echo off
Rem All the directory listings from C:\ will be routed to the file lists.txt
dir C:\>C:\lists.txt
Rem Lists all directories and subdirectories recursively
dir/s
Rem Lists the contents of the directory and all subdirectories recursively, one
file per line, displaying complete path for each listed file or directory.
dir/s/b
Rem Lists all files with .txt extension.
dir *.txt
Rem Includes hidden files and system files in the listing.
dir/a
Rem Lists hidden files only.
dir/ah

出力

すべてのアクションは、バッチファイルの説明に従って実行されます。