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.
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.
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.
Use the registry path information from the script below to manually edit the settings in the registry.
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