Page 1 of 1

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

Posted: 18 May 2011 04:29
by prasad4004
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

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

Posted: 18 May 2011 08:07
by Ed Dyreen
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: