Solved

Copy selected folders with Robocopy

Posted on 2013-11-20
3
444 Views
Last Modified: 2013-11-21
I have a file server that has home drives for hundreds of users which we are migrating to a new server share.  There are about 10 sub-folders under the "Home" parent folder and within those 10 sub-folders are the user home directories for their particular place of employment.  I'd like to selectively copy the specific folders that are still in use to the new share.  I've researched robocopy and it appears that this is not an option with that tool.  So I was hoping to using Robocopy within a for /f loop to select the appropriate folders, and then copy them to the destination.  


Is this at all possible?  Is there an easier way?  I love robocopy but it only works well with source to destination copies and not very well with particular files/folders.  Thank you for your help.
0
Comment
Question by:netfriendsinc
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
etech0 earned 500 total points
ID: 39664057
Offhand, I can think of two methods to try:
1. Write up a script that has a robocopy line for each folder you want to copy
2. Use one robocopy line with the /xd switch to exclude any directories you don't want to copy, and/or /xf to exclude files
0
 

Author Comment

by:netfriendsinc
ID: 39667161
that'll do donkey!  Thank you very much!
0
 
LVL 10

Expert Comment

by:etech0
ID: 39667171
Glad to help!
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

863 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

22 Experts available now in Live!

Get 1:1 Help Now