Solved

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

Posted on 2014-04-18
4
521 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 56

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

628 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