Skip to content

Instantly share code, notes, and snippets.

@jcefoli
Created February 15, 2025 22:01
Show Gist options
  • Save jcefoli/1951ce7316ce2351fe1db3ec355a2249 to your computer and use it in GitHub Desktop.
Save jcefoli/1951ce7316ce2351fe1db3ec355a2249 to your computer and use it in GitHub Desktop.
Rename Windows User Profile Directory

Instructions to Rename User Profile Directory

In Windows 11, when setting up your MSFT Account, the OS defaults to the first 5 characters of your MSFT account for your user profile directory (ie- C:\Users\12345). These instructions are how to rename the directory safely.

Steps

  1. Enable local administrator account and log in as it

  2. Make replacements in Windows Registry. Find the acct sid and change the username there (Update this with the exact path)

  3. Rename C:\Users\12345 to the new username

  4. Add symlink just in case anything references it (update command here later)

  5. Run command to rename local user: Rename-LocalUser -Name "$env:username" -NewName "NewUsername" Or using WMIC if that didn't work. I can't remember wmic useraccount where name="$env:username" rename "NewUsername"

  6. Reboot and test

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