Profile Folders Locations

A user's My Documents folder can be redirected to alternate locations, including network shares. Occasionally this mapping becomes corrupted, or the computer is removed from the network, leaving the user profile incomplete and potentially damaged. The default locations can be reset with a batch script (or manually with regedit.) It should be noted that this does NOT recover any files, files remain in the location the folder had been directed to. If that location is not accessible (via a mapped drive, UNC path or direct access to the host computer) then those files are lost.

Folder redirection is often done for security and backup purposes. Files store on a central server can be backed up more easily. And they are not lost if the user's computer is lost or damaged. You should not redirect folders on a laptop, use some other means of syncing the local folder and the backup folders (such as Robocopy). If redirecting several computers or user's files keep in mind that the destination must be big enough. You cannot store 500GB of files on a 250GB disk.

To redirect the folders

  1. Log in as the desired user
  2. Open a Windows Explorer window. In Windows 7 you can open the start menu and click the user's name at the top of the menu. Alternatively from any file explorer window; type the username in the address bar and press enter.
  3. The following folders can be redirected:
    1. Desktop *
    2. Downloads
    3. Favorites
    4. My Documents
    5. My Pictures
    6. My Music
    7. My Videos
  4. Right-click the desired folder, find the 'Location' tab and enter the desired path. Be sure to test the path before hand.

It is important to keep in mind that redirecting these folders will actually move these files to a different location, either on the local computer or a network share. Redirecting the Desktop folder can drastically slow down the login process. As mentioned about you need to be sure that the destination location has enough space to hold all the files you are redirecting.

Resetting the Default location

To set the location back to the default simply undo the steps above. If the computer is removed from a network before the redirection is reset you can still reset the default path. Although the files in those folders will not magically come back.

Using Regedit

Use the registry path information from the script below to manually edit the settings in the registry.

Using a Script

The following script can be modified to reset any of the profile folders. Just change the word 'Documents' to the correct folder name.

@echo off 

:: Created by: Shawn Brink
:: http://www.sevenforums.com
:: Tutorial: http://www.sevenforums.com/tutorials/18583-user-folders-restore-default-location.html


taskkill /f /im explorer.exe

timeout /t 2 /nobreak >nul

if not exist "%UserProfile%\Documents" mkdir "%UserProfile%\Documents"

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v "Personal" /t REG_SZ /d "C:\Users\%USERNAME%\Documents" /f

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v "Personal" /t REG_EXPAND_SZ /d %%USERPROFILE%%"\Documents" /f

attrib +r -s -h "%USERPROFILE%\Documents" /S /D

timeout /t 1 /nobreak >nul

start explorer.exe

Last modified:: 2016/06/06 15:32