Solved

Script to move folders(robo copy)

Posted on 2011-03-11
6
1,051 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server 2008 R2 - Execution Plan 3 31
Restore DNS Record 5 48
Automate switch config backup 3 24
Powershell 3 24
Synchronize a new Active Directory domain with an existing Office 365 tenant
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

746 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

11 Experts available now in Live!

Get 1:1 Help Now