Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Script to change the location of Documents folder in Windows 7

03 Aug 2014   #1

Windows 7
Script to change the location of Documents folder in Windows 7

Hi! I currently inherited a Windows 7 image that has the default location for the users' My Documents folder configured incorrectly. When a domain or local user account logs in to the machine for the first time the Documents directory, which by default should be located on %userprofile%\Documents and C:\Users\Public, is being set to point to the "My Documents" SHORTCUT folder and not the actual Documents folder inside C:\Users\%username%\. See screenshot.

I'd like to fix this by running a script that will remove both directories and only specify C:\Users\%username%\Documents as the only and default My Documents directory for the user.

Unfortunately, doing this via Group Policy is not an option. And since the image I am using was created by a previous technician I couldn't just create a new image since there are tons of software and customization already incorporated on it. I also tried exporting and importing the registry key for it on the explorer shell but that only seemed to work for the user where I exported the key from.

It would be nice if I have a more permanent fix for it so any new user logging in would have the correct path already set instead of me running a script for every user to fix it but if there's a simply and quick script to do it I can live with that.

Attached Images
Script to change the location of Documents folder in Windows 7-documents_old.jpg Script to change the location of Documents folder in Windows 7-documents_new.jpg 
My System SpecsSystem Spec
04 Aug 2014   #2

Windows 8.1 Pro x64

Hi Medyo,

Take a look at these guides to see if they do what you are trying to achieve.

My System SpecsSystem Spec

 Script to change the location of Documents folder in Windows 7

Thread Tools

Similar help and support threads
Thread Forum
How to move the location of the 'My Documents' folder
How do I relocate the folder 'My Documents' in Win7 Ultimate. When I installed Win7 in March 2010 I moved it from the C: drive (where Win7 was installed and where C: was one of 4 partitions on my No 1 physical hard disk drive, the other partitions being D:, E:, and F:) to my main data drive (H:)...
General Discussion
My Documents Folder - Location
Hi All, I somehow moved the "My Documents" folder into the "Downloads" folder. Is there some way to move it back to where it belongs? The "Public Documents" folder still shows in the Documents dropdown. Thanks, Jim
General Discussion
Why User folder shows My Documents but folder location is Documents?
Q1. When I look at the folders in C:\Users\User-Name , I can see a folder. I double click on and the location now is C:\Users\User-Name\Documents , why is the folder name different from the exact folder location? (I notice all other folders that have the word "My" has the same situation) Q2....
General Discussion
How to change dfault location of --MY DOCUMENTS
Have just installed win 7 Prof upgrade. I have read the---how to change the default location of user folders in win 7 and win8. The problem with this and other ways always come down to a tab called --LOCATION--. I have only five tabs in properties on my documents folder (that I want to move MY...
General Discussion
Change Location of My Documents
I'd like to change the location of My Documents, but they've removed the location tab that was present in Vista. What I'm looking to do is set the location of My Documents to E: (Western Digital 1TB My Book) as opposed to C: (Primary 150GB Hard-Drive) because of the much needed storage space. ...

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 00:38.
Twitter Facebook Google+