简体   繁体   English

通过批处理文件打印目录中的所有文件

[英]Print all the files inside a dir through batch file

我想在DOS中编写一个批处理文件,该文件从输入目录中读取所有文件,并使用FOR循环在屏幕上显示文件列表。

dir for the files in the directory dir中文件的目录

dir /s if you want to include the files in the sub-directories. dir /s如果要在子目录中包含文件)。

microsoft command line reference

edit: 编辑:

FOR %%i IN (*.*) DO echo %%i

This will print out the names of all the files in the directory you run the batch file in. 这将打印出您运行批处理文件的目录中所有文件的名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 批处理文件列出Windows 7中目录中的所有文件 - Batch file to list all files in a dir in windows 7 批处理文件,将打印目录中的所有文件(.pdf和.docs) - Batch file that will print all files (.pdf's and .docs) in a directory 使用批处理文件,如何删除不在Windows目录中的所有文件? - using a batch file, how can i delete all files not in the windows dir? 通过dir命令批量获取文件的反列表 - Get inverse list of files through dir command in batch 我想通过批处理文件关闭所有打开的窗口和文件 - I want to close all open windows and files through batch file 尝试打印到带有批处理文件的文件 - Trying to print to a file with batch files 批处理-为什么成功的dir语句会打印“找不到文件”? - batch - Why does successful dir statement print File Not Found? 如何将压缩的文件夹名称附加到批处理文件中的所有文件中 - How to attach the zipped folder names to all the files inside it in batch file 将特定文件夹内的所有文件和文件夹复制到批处理文件中 - Copy all files and folders inside specific folder in batch file 批处理文件:列出目录中的所有文件,打印为.txt并将输出文件放置在所有子目录中 - Batch Files: List all files in a directory, print as .txt and place output file in all sub directories
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM