R – Windows Vista Programmatically remap user directories

user-environmentwindowswindows-vista

I re-image one of my machines regularly; and have a script that I run after the OS install completes to configure my machine; such that it works how I like.

I happen to have my data on another drive…and I'd like to add code to my script to change the location of the Documents directory from "C:\Users\bryansh\Documents" to "D:\Users\bryansh\Documents".

Does anybody have any insight, before I fire up regmon and really roll up my sleeves?

Best Answer

I use reparse points http://www.hanselman.com/blog/MoreOnVistaReparsePoints.aspx to redirect My Documents.