Win10 export all file names under the folder

1. Method: Use cmdthe command line dircommand

Demo image:

insert image description here

Second, the specific use of the command:

dir /B >>  d:/a.txt

3. Command Explanation

dir /BList all files in the current directory,

>> d:/a.txtExport the file to a.txt under the d drive

Rendering:insert image description here

Fourth, Dir parameter supplement

The above /Buses empty format, that is, no modification. If you need to set some formats, such as: time, arrangement order, you can refer to the following dir command parameters

  [drive:][path][filename]
              指定要列出的驱动器、目录和/或文件。

 
 /A      显示具有指定属性的文件。
 属性     D  目录         R  只读文件
         H  隐藏文件       A  准备存档的文件
         S  系统文件       I  无内容索引文件
         L  解析点       -  表示“否”的前缀
 /B      使用空格式(没有标题信息或摘要)。
 /C      在文件大小中显示千位数分隔符。这是默认值。用 /-C 来禁用分隔符显示。
 /D      跟宽式相同,但文件是按栏分类列出的。
 /L      用小写。
 /N      新的长列表格式,其中文件名在最右边。
 /O      用分类顺序列出文件。
 排列顺序   N  按名称(字母顺序)   S  按大小(从小到大)
          E  按扩展名(字母顺序)  D  按日期/时间(从先到后)
          G  组目录优先      -  反转顺序的前缀
 /P      在每个信息屏幕后暂停。
 /Q      显示文件所有者。
 /R      显示文件的备用数据流。
 /S      显示指定目录和所有子目录中的文件。
 /T      控制显示或用来分类的时间字符域。
 时间段    C  创建时间
       A  上次访问时间
       W  上次写入的时间
 /W      用宽列表格式。
 /X      显示为非 8.3 文件名产生的短名称。格式是 /N 的格式,
       短名称插在长名称前面。如果没有短名称,在其位置则
       显示空白。
 /4      用四位数字显示年
 
 可以在 DIRCMD 环境变量中预先设定开关。通过添加前缀 - (破折号)
来替代预先设定的开关。例如,/-W。
上面是CMD命令自带的说明文件。

dir /d      只显示当前目录下的文件名称

dir /od     按文件修改时间排序,递增;

dir /o-d    按文件修改时间排序,递减

dir /od/tc   按文件创建时间排序,递增

dir /o-d/tc  按文件创建时间排序,递减

dir/on 按文件名排序对应,递增

dir/o-n 按文件名排序对应,递减
 

dir/oe 按扩展名排序对应,递增

dir/o-e 按文件名排序对应,递减

Reference article: https://blog.csdn.net/qq_38989725/article/details/78643417

Guess you like

Origin blog.csdn.net/VariatioZbw/article/details/111312309