Skip to content

A PowerShell script to safely relocate Windows user folders (Documents, Downloads, Pictures, etc.) to another drive. Supports dry-run mode, registry updates, robocopy moves, progress display, and logging.

License

Notifications You must be signed in to change notification settings

r3dvorak/userfolder-relocator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

UserFolder Relocator

A PowerShell script to safely relocate Windows user folders (Documents, Downloads, Pictures, Music, Videos, Desktop, Favorites, Contacts) from their default location in C:\Users\<username> to another drive or base path (e.g. D:\Gerhard).

This script updates the registry entries in
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
and moves the files using robocopy, ensuring file attributes and timestamps are preserved.


โœจ Features

  • Relocates standard Windows Known Folders (Documents, Pictures, etc.)
  • Supports dry-run mode (preview changes without moving anything)
  • Provides an interactive menu to choose which folders to move
  • Detects if a folder is already redirected and lets you skip or continue
  • Asks before creating the base path if it doesnโ€™t exist
  • Shows a progress bar for folder operations
  • Logs all actions to a file (UserFolderMove.log)

๐Ÿ”ง Requirements

  • Windows 10 or 11
  • PowerShell 5+
  • robocopy (included with Windows)
  • Execution Policy allowing local scripts

If youโ€™ve never run custom PowerShell scripts before, you may need to enable execution once:

Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

๐Ÿš€ Usage

  1. Clone or download this repository.
  2. Open PowerShell.
  3. Run the script (adjust path as needed):
    D:\moveuserfolders.ps1
  4. Enter the new base path (e.g. D:\Gerhard).
  5. Choose dry-run (Y) to preview, or N to actually move.
  6. Select which folders to relocate from the menu.

๐Ÿ“ Example Run

Enter the new base path (e.g. D:\Gerhard): D:\Gerhard
=== Starting User Folder Move Script ===
Run in dry-run mode (no changes made)? (Y/N): Y

Select which folders to move (comma-separated numbers, or press Enter for all):
[1] Documents
[2] Music
[3] Pictures
[4] Downloads
[5] Desktop
[6] Favorites
[7] Videos
[8] Contacts

Enter your choice: 1,3,4
Selected folders: Documents, Pictures, Downloads

[Dry-Run] Would move Documents from C:\Users\Gerhard Wagner\Documents to D:\Gerhard\Documents
[Dry-Run] Would update registry Personal -> D:\Gerhard\Documents

[Dry-Run] Would move Pictures from C:\Users\Gerhard Wagner\Pictures to D:\Gerhard\Pictures
[Dry-Run] Would update registry My Pictures -> D:\Gerhard\Pictures

[Dry-Run] Would move Downloads from C:\Users\Gerhard Wagner\Downloads to D:\Gerhard\Downloads
[Dry-Run] Would update registry {374DE290-123F-4565-9164-39C4925E467B} -> D:\Gerhard\Downloads

Dry-Run finished. No changes were made.
=== Script Finished ===

About

A PowerShell script to safely relocate Windows user folders (Documents, Downloads, Pictures, etc.) to another drive. Supports dry-run mode, registry updates, robocopy moves, progress display, and logging.

Resources

License

Stars

Watchers

Forks

Packages

No packages published