批量文件在目录中列出文件,只有文件名? [英] Batch File; List files in directory, only filenames?

查看:152
本文介绍了批量文件在目录中列出文件,只有文件名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个非常简单的问题,但我遇到麻烦。基本上,我试图写一个批处理文件,我需要它来列出某个目录中的所有文件。 dir命令将会这样做,但也会提供一些其他信息;我希望它只列出文件名。



我只是希望输出如下所示:

  file1.txt 
file2.txt
file3.txt

提前谢谢!

解决方案

  dir / b / ad 

有关更多信息,请参阅 dir /?



基本上, / b 是您要查找的。

/ ad 将排除目录名


this is probably a very simple question but I'm having trouble with it. Basically, I am trying to write a Batch File, and I need it to list all the files in a certain directory. The 'dir' command will do this, but it also gives a bunch of other information; I want it to list ONLY the filenames.

I just want the output to look like this:

file1.txt
file2.txt
file3.txt

Thank you in advance!

解决方案

dir /b /a-d

For more information see dir /?

Basically the /b is what you look for.

/a-d will exclude directorynames

这篇关于批量文件在目录中列出文件,只有文件名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆