Batch file 2 check folder for files under x

Closed
TripleD - Oct 22, 2008 at 05:18 AM
 TripleD - Oct 22, 2008 at 07:15 AM
Hello,

I'm trying to put a batch file together that checks a folder for all files under 1Mb, then if they are under 1Mb then run a program, if they are over 1Mb copy to an alternate folder then display a message saying x files have been copied to y location.

Is this simple? or should I be looking at another way?
Related:

1 response

This is what I have so far:

@echo off
Rem Echo Filename & Size
for %%a in (dir C:\test\*.*) do (
if %%~za GTR 131072 (
xcopy /Y "%%a" C:\over
)
)
echo carry on with program

Which works but I'm having a problem outputting the logging. I want to give a list of all files copied to C:\over to the user in notepad, but when I try it's displaying a seperate notepad for each file. xcopy doesn't give a log, so I can't use that.
Any ideas?
0