此批处理命令列出目录的内容。
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
所有操作均按照批处理文件中的备注执行。
参考链接
https://www.learnfk.com/batch-script/batch-script-dir.html
标签:files,批处理,无涯,Lists,DIR,file,Rem,txt,dir From: https://blog.51cto.com/u_14033984/8203807