How to restore D:\Users back to C:\Users after move [Vista]

0

What will be the best way be to restore D:\Users back to C:\Users after move? Computer is running on Vista OS and I think to get Users folder on another partition was used method described here https://serverfault.com/questions/8187/whats-the-best-way-to-move-c-users-to-d-users-under-vista-w7

robocopy C:\Users D:\Users /mir /xj /copyall
mklink C:\Users D:\Users /j

I need to get User folder back on C due failure upgrade to Windows 7 (doesn't recognize that User folder is on D:)

Not sure if steps below are sufficient enough to accomplish that task:

rmdir C:\Users                      #remove junction link
robocopy D:\Users C:\Users /e /xj /copyall
rmdir /S /Q D:\Users
mklink D:\Users C:\Users /j         #to be safe if something will try to save to D:\Users

JackTheKnife

Posted 2015-10-02T14:02:27.900

Reputation: 103

Answers

1

Last year I went the exact same route you did. IIRC, the solution you wrote was roughly what I ended up using, so I think it's okay.

For safety, though, don't run the third command (rmdir /S /Q D:\Users) just yet.

Before obliterating D:\Users, it's better just to rename it to something else and see if something breaks during boot. If by chance things get nasty, renaming it back will guarantee the previous state, which you won't be able to do if you rmdir /s it beforehand.

Also, instead of the last step (mklink D:\Users C:\Users /j), I'd rather use a batch search-and-replace on the registry to change all occurences of D:\Users back to C:\Users (and maybe let outstanding applications fail -- this is up to you, I just didn't want another junction). I vaguely remember having to be a bit creative on this part, because sometimes the path was stored like D/Users or D:\\Users. Maybe I used regex to accomplish that. Use a good registry tool (I used RegEditX).

So, summing up, I would recommend:

rmdir C:\Users                      #remove junction link
robocopy D:\Users C:\Users /e /xj /copyall
rename D:\Users D:\UsersOld
# try booting
# search and replace registry
# use system for a couple of weeks
rmdir /S /Q D:\Users

Small note: it's not the case that Windows "doesn't recognize" that the Users folder is in D:. Windows knows you moved it around and replaced the original path with a junction, and deliberately prevents updating (this is conspicuous in the logs).

André Chalella

Posted 2015-10-02T14:02:27.900

Reputation: 1 088

With the robocopy is better to use \e or \mir option and then skip two steps and use your solution to replace in the registry? – JackTheKnife – 2015-10-02T14:41:01.900

Your comment is ambiguous, could you please rephrase? I don't understand if you: a) want to know if it's better to use /e or /mir or b) want to confirm a new plan (robocopy with either switch then skip two steps then replace registry entries). – André Chalella – 2015-10-02T14:53:01.437

Option a) - which one is better to go for? – JackTheKnife – 2015-10-02T15:33:48.097

1They should be equivalent, since the destination (C:\Users) won't exist before the command. Please make sure you don't misspell the forward slash (/) like you did in the comment (you wrote backslashes). Also, see the edit I'm about to make. – André Chalella – 2015-10-02T15:36:33.207

I have ended up with adding /zb trigger to the robocopy line as I had multiple Access Denied errors during copying files (something wrong with ACL). System booted w/o any issues but didn't checked functionality yet. – JackTheKnife – 2015-10-05T13:42:21.707