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?
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?
How about something like this?
dir /b "C:\My Path" > myFiles.txt
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"
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
).