How to copy list of file names in a directory to a log file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
prasad4004
Posts: 1
Joined: 18 May 2011 04:14

How to copy list of file names in a directory to a log file

#1 Post by prasad4004 » 18 May 2011 04:29

I have successfully moved specific set of files from one directory to another using batch file.
This time I need to copy these specific set of file names (say all .dat files) to a log file with count. Could anyone help me to resolve this.

Thanx
PRS

Ed Dyreen
Expert
Posts: 1569
Joined: 16 May 2011 08:21
Location: Flanders(Belgium)
Contact:

Re: How to copy list of file names in a directory to a log f

#2 Post by Ed Dyreen » 18 May 2011 08:07

copying files based on extension is easy

Code: Select all

xcopy "*.dat" "@Directory"


the count thing is more difficult, I suggest experimenting with FindStr.EXE or Find.EXE
I don't know, maybe with a pipe

Code: Select all

|FindStr.EXE "something"


Maybe RoboCopy?

Ok, I am a bit lazy, I am not going to write the script for you, but wait an expert has logged on to help u :mrgreen:

Post Reply