Skip to content

Instantly share code, notes, and snippets.

@object-Object
Created February 24, 2024 23:49
Show Gist options
  • Save object-Object/c75568fd64babd92e1deb49bf227a791 to your computer and use it in GitHub Desktop.
Save object-Object/c75568fd64babd92e1deb49bf227a791 to your computer and use it in GitHub Desktop.
How to rename your user and home folder on Windows 11

I finally got tired of my laptop deadnaming me, and decided to fix it. Here's what worked for me.

  1. Back up all drives.
  2. Back up the registry.
  3. Create a system restore point.
  4. Take a picture of your taskbar, start menu, Quick Access pinned items, and VSCode taskbar right click pinned items (if you use VSCode), since you might have to clear these.
  5. Restart your computer, and log into a different admin acount.
    • I used the hidden Administrator account, which can be activated with this command: net user administrator /active:yes
  6. Use netplwiz to rename the user: https://superuser.com/a/1011089
  7. Follow these steps to rename the home folder and update the registry: https://winhelponline.com/blog/rename-user-profile-folder-windows
    • I skipped the optional step to update INI files, because it seemed like it would take a very long time.
  8. Add a symlink from the old folder name in case any programs are still using it. Run these commands in Command Prompt (not Powershell):
    cd C:\Users
    mklink /D "old name" "new name"
    
  9. Log back into your account.
  10. If Windows Explorer is crash-looping, follow these steps:
    1. Open Task Manager by pressing ctrl+shift+esc.
    2. Click "Run new task" and type regedit to open the registry.
    3. Rename or delete this folder: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount
    4. This should stop the crash loop immediately, but you may want to restart your computer to be safe.
  11. If your Quick Access or VSCode pinned items are corrupted (eg. unpinning doesn't work), delete everything in the following folders:
    1. %APPDATA%\Microsoft\Windows\Recent\AutomaticDestinations
    2. %APPDATA%\Microsoft\Windows\Recent\CustomDestinations
    3. %APPDATA%\Microsoft\Windows\Recent

Helpful resources:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment