File Copy Utility

M

mikeita

Does anyone know of a utility that will copy a specified number of
files from a source folder to a target folder. I have an application
that can only handle processing 500 files at a time. I have 220,000
files that need processing. I would like to schedule the next 500 to
be copied to the target when 500 complete. I have hunted around for
all the regular applications (Robocopy, xcopy, xxcopy etc) but none
have the ability to copy just any 500 files at a time. Is there a
better way to throttle these files 500 at a time from the source to
target??
 
J

Jon Scott

Does anyone know of a utility that will copy a specified number of
files from a source folder to a target folder. I have an application
that can only handle processing 500 files at a time. I have 220,000
files that need processing. I would like to schedule the next 500 to
be copied to the target when 500 complete. I have hunted around for
all the regular applications (Robocopy, xcopy, xxcopy etc) but none
have the ability to copy just any 500 files at a time. Is there a
better way to throttle these files 500 at a time from the source to
target??

The good ol' MOVE in XP works fine. I wrote up a couple of test batch files
that do what you want.

MoveXFiles.bat :

set /a moveindex=0
for %%f in ("C:\Temp\Test\*.txt") do call MoveOneFile.bat "%%f"

MoveOneFile.bat :

if %moveindex%==500 goto End
move /y %1 "C:\Temp\Test\Test2"
set moveindex
set /a moveindex=%moveindex%+1
:End



What the above will do is move up to 500 txt files from C:\Temp\Test to
C:\Temp\Test\Test2. Just replace the appropriate paths to suit your needs
and execute MoveXFiles.bat. While this isn't a "copy", but rather a "move",
this prevents re-copying over an already copied file.
 
J

Jon Scott

MoveOneFile.bat :
if %moveindex%==500 goto End
move /y %1 "C:\Temp\Test\Test2"
set moveindex
set /a moveindex=%moveindex%+1
:End


Actually, the above should be:

MoveOneFile.bat :

if %moveindex%==20 goto End
move /y %1 "C:\Temp\Test\Test2"
set /a moveindex=%moveindex%+1
:End
 
M

mikeita

Actually, the above should be:

MoveOneFile.bat :

if %moveindex%==20 goto End
move /y %1 "C:\Temp\Test\Test2"
set /a moveindex=%moveindex%+1
:End



Thanks much for the response it worked great!!


Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top