
- 批處理指令碼教程
- 批處理指令碼 - 主頁
- 批處理指令碼 - 概述
- 批處理指令碼 - 環境
- 批處理指令碼 - 命令
- 批處理指令碼 - 檔案
- 批處理指令碼 - 語法
- 批處理指令碼 - 變數
- 批處理指令碼 - 註釋
- 批處理指令碼 - 字串
- 批處理指令碼 - 陣列
- 批處理指令碼 - 決策
- 批處理指令碼 - 運算子
- 批處理指令碼 - DATE & TIME
- 批處理指令碼 - 輸入/輸出
- 批處理指令碼 - 返回程式碼
- 批處理指令碼 - 函式
- 批處理指令碼 - 程序
- 批處理指令碼 - 別名
- 批處理指令碼 - 裝置
- 批處理指令碼 - 登錄檔
- 批處理指令碼 - 網路
- 批處理指令碼 - 列印
- 批處理指令碼 - 除錯
- 批處理指令碼 - 日誌
- 批處理指令碼資源
- 批處理指令碼 - 快速指南
- 批處理指令碼 - 有用資源
- 批處理指令碼 - 討論
批處理指令碼 - 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
輸出
所有操作都根據批處理檔案中的備註執行。
batch_script_commands.htm
廣告