Page 1 of 1

Urgent - Copy Batch of 10 files to dst folder every 5 min

Posted: 18 Mar 2010 02:27
by venred
Hi All,

It would be great help if any one will provide the BAT solution.

We have a requirement to create clones of .tif images and created batch folders which contains 10 images and each batch will be copied to the destination drive (z:\) for every 5 minutes.

Ex:

Source folder: Destination Drive
C:\Batch1 (10 .tiff images) Z:\
C:\Batch2 (10 .tiff images) Z:\
C:\Batch3 (10 .tiff images) Z:\
. Z:\
. .
.
etc..

After every 5 minutes each batch(10 images) will be copied into destination folder z:\ drive.

Thanks in advance.

Regards,
Venred

Re: Urgent - Copy Batch of 10 files to dst folder every 5 mi

Posted: 19 Mar 2010 03:45
by venred
It would be really helpfull for me, if anyone will through light on this please.

Re: Urgent - Copy Batch of 10 files to dst folder every 5 mi

Posted: 19 Mar 2010 15:54
by avery_larry
Something like this?

*untested*

Code: Select all

@echo off
cd /d c:\

:loop
cls
echo Copying files from batch* folders to z:\
for /d %%a in (batch*) do copy "%%a\*.*" z:\
::wait 5 minutes
echo Wait 5 minutes
ping -n 300 -w 999 127.0.0.1 >nul 2>nul
goto :loop

Re: Urgent - Copy Batch of 10 files to dst folder every 5 mi

Posted: 24 Mar 2010 08:38
by venred
HI Larry,

Thanks you very much for the reply.

Could you please provide enhanced code as it is copying all the files repeately every 5 minutes?

For ex: Each batch contains 10 files, Batch 1, Batch 2, Batch 3. All 30 files are copying every five minutes.

Here the requirement is after every 5 minutes one batch will be copied to the destination folder z:\

Could you please through some light?

Thanks in advance.

Regards,
Venred

Re: Urgent - Copy Batch of 10 files to dst folder every 5 mi

Posted: 26 Mar 2010 09:46
by avery_larry
You mean you want one of the batches copied each 5 minutes, and then looped?


Try this:

Code: Select all

@echo off
cd /d c:\

:loop
cls
echo Copying files from batch* folders to z:\
for /d %%a in (batch*) do (
   time /t
   echo Copying %%a now . . .
   copy "%%a\*.*" z:\
   time /t
   echo Wait 5 minutes
   ping -n 300 -w 999 127.0.0.1 >nul 2>nul
)
goto :loop

Re: Urgent - Copy Batch of 10 files to dst folder every 5 mi

Posted: 29 Mar 2010 03:57
by venred
Hi Larry,

Millions of thanks for this. :D

Regards,
Venred