Moving WinXP’s My Documents

The My Documents directory location is stored in the registry at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders in a key called personal.

The following script is what I use to remap this to u:/documents:

  1. ;; create some dirs:
  2. u:
  3. mkdir documents
  4. mkdir outlook
  5.  
  6. ;; Move My Documents folder:
  7. ;; delete current setting
  8. reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal /f
  9. ;; create new setting
  10. reg.exe Add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal /t REG_SZ /d u:/documents