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: User Folders - Restore Default Location

04 May 2015   #270
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by Brink View Post
I don't like leaving anything set incorrectly whether it's redundant or not.
I don't disagree.


Quote   Quote: Originally Posted by Brink View Post
Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by Brink View Post
I would love to, but can't do a .reg file for the "Shell Folder" location since it's data values must use the full path with user name instead of with a variable like the "User Shell Folder" location.
Ahh, I see. That would make sense.

Hm. A batch file can fix that... which gets me thinking: ever considered an option 3 that makes use of a batch file to fix all the Shell Folders and User Shell Folders values? That would be most convenient and a really fast solution for the users who just want things fixed immediately.

It would be great to have an a .bat or .vbs file that fixes it all in one click for each folder, but I'm not sure how to call for the user name to have the registry value set with it.
Why not take advantage of the %Username% environment variable to retrieve the username, in batch? And use the Reg command to write to the registry.

E.g. A simple batch file just listing out Reg commands should do the trick.
Code:
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Music" /t REG_SZ /d "C:\Users\%USERNAME%\Music" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Pictures" /t REG_SZ /d "C:\Users\%USERNAME%\Pictures" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "My Video" /t REG_SZ /d "C:\Users\%USERNAME%\Video" /f
etc...
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Music" /t REG_EXPAND_SZ /d %%USERPROFILE%%"\Music" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Pictures" /t REG_EXPAND_SZ /d %%USERPROFILE%%"\Pictures" /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "My Video" /t REG_EXPAND_SZ /d %%USERPROFILE%%"\Video" /f
etc...



My System SpecsSystem Spec
.
04 May 2015   #271
Brink

64-bit Windows 10 Pro
 
 

Well, that sure was easy. Not sure why I didn't think of doing with a .bat.

Thank you. I'll update the tutorial later today for this.
My System SpecsSystem Spec
04 May 2015   #272
Brink

64-bit Windows 10 Pro
 
 

OPTION TWO in this tutorial has been updated to now allow you to restore the default location of user folders using a simple .bat file instead of the old harder way of manually in the registry.
My System SpecsSystem Spec
07 May 2015   #273
MarcSayer

Windows 7 Ultimate x64 & x32
 
 
Link error

The link for the Downloads bat file is the same as the one for the Documents bat file.
My System SpecsSystem Spec
.

07 May 2015   #274
Brink

64-bit Windows 10 Pro
 
 

I'm sorry about that Marc. The download link has been corrected.
My System SpecsSystem Spec
23 Jul 2015   #275
hughesjm

Windows 7
 
 

My issue was fixed when the Forum Team recommended that I use the .bat file to restore my Download Folder. Thank you!
My System SpecsSystem Spec
23 Jul 2015   #276
Brink

64-bit Windows 10 Pro
 
 

Glad it could help.
My System SpecsSystem Spec
05 Aug 2015   #277
MatthewCarter

Windows 7 Home Premium SP1 64-bit (second reinstall)
 
 

Quote   Quote: Originally Posted by Brink View Post
Quote   Quote: Originally Posted by Pyprohly View Post
Quote   Quote: Originally Posted by Brink View Post
Incorrect. Those steps do indeed need to make sure that they have the correct path as well.
Would you like to provide evidence or cite some source to support the fact that Steps 19 - 24 are important? From my testing at least, the "Shell Folders" key appears to be utterly redundant.

I had changed the value of the "My Video" entry of both the "Shell Folder" and "User Shell Folder" keys to different locations on my machine. Upon logging in again, I found that my "My Videos" folder was the location of which the "My Video" value of the "User Shell Folder" key mentions.
If you change a folder location using the GUI in OPTION ONE, it will make that change in both the "User Shell Folders" and "Shell Folders" key locations.
Regarding this, how does the UI manage these values when setting the folder to somewhere outside of %USERPROFILE%? will the values in the "Shell Folder" and "User Shell Folder" keys be the same, i.e. the full path?
My System SpecsSystem Spec
05 Aug 2015   #278
Brink

64-bit Windows 10 Pro
 
 

Hello Mathew,

To move the user folder, you would want to use the method in the tutorial below instead for it to be set properly.

User Folders - Change Default Location
My System SpecsSystem Spec
06 Aug 2015   #279
Pyprohly

Windows 10, Windows 8.1 Pro, Windows 7 Professional, OS X El Capitan
 
 

Quote   Quote: Originally Posted by MatthewCarter View Post
Regarding this, how does the UI manage these values when setting the folder to somewhere outside of %USERPROFILE%? will the values in the "Shell Folder" and "User Shell Folder" keys be the same, i.e. the full path?
Good question. This demonstration will answer that...

So default data for the value 'My Videos' of keys 'Shell Folders' and 'User Shell Folders' are "C:\Users\Pyprohly\Videos" and "%USERPROFILE%\Videos" respectively. Upon moving my 'My Videos' folder into a directory named 'New Folder', the data of the 'My Video' values change to "C:\Users\Pyprohly\New folder\Videos" and "%USERPROFILE%\New folder\Videos" as expected. Now, when I move my 'My Videos' folder outside of my user profile folder to, for instance, the root of my C drive, the data of the 'My Videos' values of 'Shell Folders' and 'User Shell Folders' become "C:\Videos" and "%SystemDrive%\Videos".

It appears both the keys 'Shell Folder' and 'User Shell Folder' are managed appropriately. They will always reference the same location. Though all data in the values of the 'Shell Folder' key will use environment variables where possible.
My System SpecsSystem Spec
Reply

 User Folders - Restore Default Location




Thread Tools




Similar help and support threads
Thread Forum
User Folders - Change Default Location
How to Change the Default Location of User Folders in Windows 7 and Windows 8 This will show you how to change (move) the default location of your account's C:\Users\(user-name) folders to another location of your choice instead in Windows 7 and Windows 8, and still have access to the user...
Tutorials
User Folders - Restore Default Icon
How to Restore Default User Folder Icons in Windows 7 and Windows 8 This tutorial will show you how to restore the default folder icon for all of your personal user folders icons in the Start Menu (Windows 7 only) and C:\Users\(user-name) locations in Windows 7 and Windows 8. EXAMPLE:...
Tutorials
how to restore default location of ''my documents''?
hello, Like the title says, I changed default location of my documents using: properties -> move... Now the problem is I changed it to my Data partition E: instead of to a directory ''documents'' I made on the data partition. Now I can not click properties to change it back to default....
Installation & Setup
Change location of user folders?
I usually try to separate data from system files and programs, to counter defragmentation and for better backup possibilities. So I would like to change the location of the user folders (by default: c:\users) so that user data is stored on my data partition instead (d:\users). So far I was able to...
Customization
User Folders - Restore Default Location Issue
Hello all Having "lost" several Windows 7 user files, the special ones with Location tabs, I have followed Brink's tutorial to recreate them: Contacts, My Music and My Pictures. My Music has worked - thanks to Brink! It is back in the user folders and has a Location tab (though does not show...
Customization
Moving Default User Doc Location?
Good Evening. So, with no prior testing I decided to move to Window 7 and I'm having two main issues. 1 - I have for the past few years always put My Documents on another drive. So it would go C for Windows, D for Progs and E for My Docs. I cannot for the life of me figure it out in...
Installation & Setup


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 20:43.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App