Windows Vista Programmatically remap user directories

407 views Asked by At

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?

2

There are 2 answers

0
Scott Hanselman On BEST ANSWER

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

0
macbirdie On

SHSetFolderPath Function should help, since this article mentions its use for folder redirection by the Group Policy API.