Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently working on migrating users to Windows 7 from XP. We use roaming profiles. Xp creates a folder named "Profile", while Windows creates "Profile.V2". Theses folders are independent of each other and do not synchronize. Users "lose" their desktop Favorites etc when using 7 for the first time. I'd like to script a solution which will copy (specific) data from "Profile" to "Profile.v2". Here's a basic outline of what I'd like to do:

# Check for location of users profile folder
#I realize I will need an "if" statement here:

\\server_1\%username%\profile   #eg... Boolean=False
\\server_2\%username%\profile   #eg... Boolean=True
\\server_3\%username%\profile   #eg... Boolean=False

# When true begin to iterate xcopy

xcopy /s/e/f \\server_2\users\%username%\profile\[My Documents] -> %HOMEPATH%\My Documents
xcopy /s/e/f\ \server_2\users\%username%\profile\[Desktop] -> %HOMEPATH%\Desktop
xcopy /s/e/f\ \server_2\users\%username%\profile\[Favorites] -> %HOMEPATH%\Favorites
xcopy /s/e/f\ \server_2\users\%username%\profile\[Favorites] -> %HOMEPATH%\Favorites
xcopy /s/e/f\ \server_2\users\%username%\profile\[app data]\Microsoft\Outlook\*.nk2 -> %APPDATA%\roaming\microsoft\outlook

Please keep in mind I do realize I could use other tools to accomplish this. I'm more or less interested in completing this task in this particular fashion, whether it be through batch or powershell. Thanks!

share|improve this question

closed as not a real question by MDMarra, Dennis Kaarsemaker, Ward, Hauke Laging, Wesley Jun 1 '13 at 20:41

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Have you transitioned to Windows 7 yet, or us this preparation? If you are using roaming profiles then you should also do redirected folders. Redirected folders will handle everything you are trying to migrate. – Zoredache May 31 '13 at 20:24
Also, what is your question? – Zoredache May 31 '13 at 20:25
@Zoredache I am manually having to copy to the directories I've outlined. I'd like to script this process. As it stands the script I have will not work. I guess my question is "How do I make this script work?". As stated at the end on my original post, I realize there are multiple ways to accomplish this. Folder redirection is not a requirement for roaming profiles. I just want to know how I can automate copying data using a script. – Qwilson May 31 '13 at 20:48
You're right. Redirection isn't a requirement, it's just highly recommended. If you have a chance to implement them now (and it is trivial with GPO to copy the folders you want), you should strongly consider it. – MDMarra Jun 1 '13 at 15:36
"Gimme teh codez" type questions don't really belong. I was simply offering some experience (as a comment, not an answer) to hopefully help you in the long run. Do whatever you like with the information. – MDMarra Jun 1 '13 at 20:08

USTM (User State Migration Tool) lets you selectively extract a user profile and import it on a new or refreshed PC.

share|improve this answer
My question is very specific and this does not remotely begin to answer it. As previously stated "... I do realize I could use other tools to accomplish this. I'm more or less interested in completing this task in this particular fashion..." – Qwilson Jun 1 '13 at 19:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.