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
Solved

Script to move folders(robo copy)

Posted on 2011-03-11
6
1,054 Views
Last Modified: 2012-05-11
I have a shared folder which contains user's home folder(around 500), i need to move home folder to another  server for only 50 users
i have the home folders list (which need to be moved) in a file
using robo copy i need to copy these list of folder into the new server
any one help me with a script for this
Note : i don't want to copy all the folders from source to destination i want to copy only the folders which i mentioned in a text file



0
Comment
Question by:kumarnirmal
  • 3
6 Comments
 
LVL 8

Expert Comment

by:jawa29
ID: 35108605
Hi kumarnirmal

Robocopy has a /xd command that will exclude directories with a given name. So if you got a list of the directories to exclude you could use this.

Jawa29

0
 
LVL 12

Accepted Solution

by:
prashanthd earned 500 total points
ID: 35108626
list.txt will have the folder paths to copy
change destinationpath to new server location
Try the following in a batch file

For /F "usebackq" %%A in (list.txt) do (robocopy %%A destinationpath)
0
 
LVL 12

Expert Comment

by:prashanthd
ID: 35109352
Forgot to add the /e switch

For /F "usebackq" %%A in (list.txt) do (robocopy %%A destinationpath /e)
0
 
LVL 12

Expert Comment

by:prashanthd
ID: 35154178
Hi,

Have you tried the above?
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 35687975
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…

856 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