Windows > Windows 11 >
-
2024-08-10 on Windows 11
Your username is force-renamed if you install Windows 11 online and connect a Microsoft account, and then you disconnect it. Your user directory (%USERPROFILE%
) is not renamed.
With thanks to https://www.guidingtech.com/how-to-rename-the-user-folder-in-windows-11/
ECHO %USERPROFILE%
Log in as another user ∞
This user should have access to administrator either as having permission itself, or by allowing you to enter in the administrator password when you try to perform such tasks.
Run cmd.exe
as administrator ∞
"Menu > Terminal (Admin)"
or
control-x
a
Get list of users and their SID and find the user you're interested in changing: ∞
:: Where "useraccount" is "admin" in PowerShell the code would be: SET USERNAME="Administrator" wmic useraccount get name^,SID | findstr %USERNAME%
An example output would be:
Administrator S-1-5-21-2125158385-2819574207-3500430015-500
Remember that SID
If you have trouble finding your SID (e.g. the output is empty) then just do:
wmic useraccount get name^,SID
Run regedit
as administrator ∞
You can do this with Windows-s
typing regedit
and then from the flyout menu on the right you select "Run as administrator".
At the top bar, paste the following and press enter
:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\
Then enter into folder for the SID you want to change.
Change "ProfileImagePath" ∞
(While an example .reg
could be provided, it's quite a bit more complex than you would imagine; just do things manually as I've noted)
Rename the user's folder ∞
Run cmd.exe
as administrator
"Menu > Terminal (Admin)"
or
control-x
a
C:
CD \USERS
REN OLD NEW
Where OLD
is your old username and NEW
is the new one you manually specified moments ago.
Keep the terminal open.
Run regedit
as administrator ∞
You need to make some more changes to stop explorer from complaining every time you launch it.
If you kept the cmd window open from the previous step, then just type regedit
At the top bar of regedit, paste the following and press enter
:
TODO - I can't remember specifically what I changed, but the old directories are obvious.
You may have to look for other references to correct.
Last updated 2024-08-15 at 07:40:53