Solved

Script to move folders(robo copy)

Posted on 2011-03-11
6
1,057 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
[X]
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
  • 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 71

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
In previous parts of this Nano Server deployment series, we learned how to create, deploy and configure Nano Server as a Hyper-V host. In this part, we will look for a clustering option. We will create a Hyper-V cluster of 3 Nano Server host nodes w…
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
Suggested Courses

635 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