Quackers Posted August 20, 2010 Posted August 20, 2010 Does anybody have a script that would allow me to do the following quickly. I have my current users My Documents as their home folder. E:\Homes\Users\ To accomidate Windows 7 and its annoying feature of renaming every home folder to "Documents", i have decided to alter the structure. So i will have E:\Homes\%username%\My Documents instead. I am also moving it from 1 server to another. So i could do with a quick way of moving them. Say i map Y: as the new servers Homes folder during this process. E:\Homes\User\ to Y:\Homes\User\My Documents Hope that makes sense!
mac_shinobi Posted August 21, 2010 Posted August 21, 2010 Robocopy Microsoft Robocopy GUI For Windows Robocopy Along with the robocopy GUI - link to this is on the above page. wikipedia page on robocopy - see bottom for table with versions etc http://en.wikipedia.org/wiki/Robocopy
srochford Posted August 21, 2010 Posted August 21, 2010 move e:\homes e:\homestemp md e:\homes cd e:\homestemp for /d %i in (*) do md e:\homes\%i & ren %i "my documents" & move "my documents" e:\homes\%i WARNING!!! Do make sure you've got a good backup! I've tried this on 2 folders and it works fine but I had just created them and the permissions were "correct" etc etc. If you replace the * in the final line with (say) z* then you'll only move usernames beginning with Z so you get a chance to be confident. When you do the md e:\homes step you might want to add a cacls line to set the permissions properly at the top level. The next step shouldn't need permissions changing - you're moving so the permissions will move with them. Note that this is written as a set of lines to type at the command prompt. If you put them in a batch file you need to double up the % signs (so %%i instead of %i) @mac_shinobi; - I don't think robocopy will work (I did think about it; generally for questions containing the words "move home directories" the answer is "robocopy" but I can't see how to move stuff into a sub-directory of itself hence the convoluted swap I've used. Happy to be proved wrong :-) 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now