Redirecting My Documents shell folder from a login script / commandline
I’ve always been a firm believer in Group Policy redirecting users’ My Documents folders for me – but there’s nothing like the reassurance of a good old batch file carrying this operation out for you.
So how do you do it? Well, the location of My Documents is stored in the registry (which is read by the explorer process when it’s spawned) and is located here:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal
As you would expect, editing this one value redirects My Docs. So, as part of your network login script, you can achive this automatically by adding in:
reg add “HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders” /v Personal /t REG_EXPAND_SZ /d \\server\%USERNAME% /f
…to redirect to your server using the username of the currently logged on user as the share name.
Did you find this hint useful? Are you looking to learn more? Well, here’s a few books that I’ve found useful – have a goosie!
![]() Active Directory for Dummies |
![]() Microsoft Windows Shell Script Programming |
![]() Microsoft Windows Script Host |
![]() Mastering Windows Server 2003 |





