批处理 中的 DIR函数

首页 / 批处理入门教程 / 批处理 中的 DIR函数

此批处理命令列出目录的内容。

DIR - 语法

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

所有操作均按照批处理文件中的备注执行。

无涯教程网

祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)

技术教程推荐

朱赟的技术管理课 -〔朱赟〕

从0开始学架构 -〔李运华〕

白话法律42讲 -〔周甲徳〕

分布式协议与算法实战 -〔韩健〕

说透5G -〔杨四昌〕

商业思维案例笔记 -〔曹雄峰〕

计算机基础实战课 -〔彭东〕

JavaScript进阶实战课 -〔石川〕

Go进阶 · 分布式爬虫实战 -〔郑建勋〕

好记忆不如烂笔头。留下您的足迹吧 :)