Search : in
By :

Batch file 2 check folder for files under x

Last answer on Oct 22, 2008 12:15:27 pm BST TripleD, on Oct 22, 2008 10:18:33 am BST 
 Report this message to moderators

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?

Configuration: Windows Vista
Internet Explorer 7.0

Best answers for « Batch file 2 check folder for files under x » in :
Batch file – Get Filenames & Timestamps ShowBatch file – Get Filenames & Timestamps Issue Solution Note Issue Can anyone help me create a batch file that will display all the files, subfolders and files under subfolders of folder with both date created and date modified then...
Batch file ShowBatch file Settings File Creation DOS is integrated in windows which allow to exploit functionality and command sequence in a script. A batch file is a text file which contains command to be read by DOS. This file can be launched...
What is a batch file? ShowWhat is a batch file? Creating a batch file Prerequisites Create file Windows comes with a version of DOS, which allows you,exploiting the features and the sequence of commands in a script. Batch file, is a simple text file (ascii)...

1

 TripleD, on Oct 22, 2008 12:15:27 pm BST

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?

Reply to TripleD