- 批处理脚本教程
- 批处理脚本 - 主页
- 批处理脚本 - 概述
- 批处理脚本 - 环境
- 批处理脚本 - 命令
- 批处理脚本 - 文件
- 批处理脚本 - 语法
- 批处理脚本 - 变量
- 批处理脚本 - 注释
- 批处理脚本 - 字符串
- 批处理脚本 - 数组
- 批处理脚本 - 决策
- 批处理脚本 - 运算符
- 批处理脚本 - 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
广告