Solved

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

Posted on 2014-04-18
4
511 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
Comment Utility
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 24

Expert Comment

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

Accepted Solution

by:
Bill Prew earned 500 total points
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
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…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

772 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

9 Experts available now in Live!

Get 1:1 Help Now