Script to move folders(robo copy)

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



LVL 7
kumarnirmalAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
prashanthdConnect With a Mentor Commented:
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
 
jawa29Commented:
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
 
prashanthdCommented:
Forgot to add the /e switch

For /F "usebackq" %%A in (list.txt) do (robocopy %%A destinationpath /e)
0
 
prashanthdCommented:
Hi,

Have you tried the above?
0
 
Chris DentPowerShell DeveloperCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.