Is this possible to write list of file names into

2019-03-17 22:40发布

I want to write the list of file names from a Given directory path in to text file whenever clicking a windows XP batch file.I don't know whether it is possible or not in Windows Xp?

So,Can u please enlighten me on this?

3条回答
Luminary・发光体
2楼-- · 2019-03-17 22:40

In a detailed way

@echo off
Rem Following command will write the names of all files in a text file
dir "C:\Source folder" > C:\destination.txt
echo "File names have been written"
查看更多
劳资没心,怎么记你
3楼-- · 2019-03-17 22:51

How about something like this?

dir /b "C:\My Path" > myFiles.txt
查看更多
祖国的老花朵
4楼-- · 2019-03-17 22:59

If you want to list down all the file names with other details like time/size etc and no other directory information, you can use the below command

DIR c:\temp\*.* | FIND ":" > logfile.txt

This will obtain a bare DIR format (no heading or footer info) but retain all the details, pipe the output of DIR into FIND.
This assumes that your date time stamp separator is : (e.g. 09-04-2018 11:06).

查看更多
登录 后发表回答