Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1059
  • Last Modified:

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



0
kumarnirmal
Asked:
kumarnirmal
  • 3
1 Solution
 
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:
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
 
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

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now