Solved

Copying files in batches from a server to another mapped drive folder

Posted on 2014-04-18
4
515 Views
Last Modified: 2014-05-09
Hi,

 I have a folder called SRCFILES which has some 15000 files. I want to write a batch that copies these files in batches of <n> to another drive folder say \\XOXO\DESTFILES. They are sorted by filename.

How can I do this?
0
Comment
Question by:LuckyLucks
4 Comments
 
LVL 4

Expert Comment

by:wsawalhi
ID: 40009190
Folder Copy and backup works very well and it is free...

http://download.cnet.com/Folder-Copy-Backup/3000-2248_4-10876816.html


I hope this helps!
0
 
LVL 25

Expert Comment

by:Mohammed Khawaja
ID: 40009241
Try Robocopy as it is great for copying/synchronizing folders. Can pickup where it left off copying files, bit level changes, etc.
0
 
LVL 53

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 40009811
Can you share a little more about what you are trying to accomplish and how you will process these batches?  Why are you breaking the copy up into batches?  Is speed a concern?  Etc...

~bp
0
 
LVL 7

Expert Comment

by:leflon
ID: 40024516
Hi,

if you want to stick to basic cmd syntax you could try the following to move a given number of files

echo off
SETLOCAL EnableDelayedExpansion
set noOfMovedFiles=0
for /R .\src\ %%N in (*) do (
    echo moving... "%%N"
    move /Y "%%N" .\dest\
    set /a noOfMovedFiles+="1"
	REM Stop once you moved 5 files.
    if !noOfMovedFiles! EQU 5 GOTO endOfCopy
  )
  :endOfCopy
  echo Done, Copied %noOfMovedFiles% files!
  pause
ENDLOCAL

Open in new window

Here I only move 5 files. You have to adjust the number and the src and dest directories.
Additionally you have to wrap this with a loop that continues copying while there are still files in the src directory.

hth
leflon
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now