444

After installing Windows 10 on my Surface Pro 3 it took my user name 'Jeremy' and created a user folder named C:\Users\jerem.

I want to rename the folder C:\Users\Jeremy. The procedure for Windows 8 does not work. There are a couple of reasons.

  1. OneDrive is now a fully integrated part of the OS, and it completely breaks. A find/replace in the registry seems to work, but it's hard to be confident in that approach.
  2. When the computer is rebooted, the TabletInputService writes a TextHarvester.dat file to the old user profile location (creating it if needed). This makes it impossible to keep the folder deleted. An old solution found online doesn't work. This issue also causes an error message to pop up every time the computer boots.
Peter Mortensen
  • 12,090
  • 23
  • 70
  • 90
GollyJer
  • 7,150
  • 8
  • 38
  • 45
  • 10
    @MehmetFide it's not a bug - it take the first five letters from your email address - this is by design, not an error. – CalvT Sep 25 '15 at 15:12
  • 186
    so it is a design bug. my name is "mehmet" and it puts as "mehme" which is annoying and silly. it is clearly a bug from customer point of view. – Mehmet Fide Sep 25 '15 at 16:43
  • 14
    @CalvT do you have a source stating this was a design decision? And _why_? Seems silly to me. – Keegan Oct 13 '15 at 13:53
  • OK, so it makes a decision that may or may not be right from the customer's point of view. The question is how does the user *change* it? – Edward Falk Sep 06 '16 at 19:34
  • 5
    @MehmetFide Well, it's part of the effort to make paths short. Most programs still choke on paths longer than about 250 characters, and that was a problem that was getting out of hand. That's also why the Users folder is no longer Documents and Settings :) – Luaan Dec 18 '16 at 17:44
  • 14
    Got a Surface Book, I'm here because I noticed the same issue. What a freaking annoyance, trimming two letters off the user name I've used for two decades. – mlepage Jan 21 '17 at 02:27
  • 27
    It should at least ask before doing this, and offer the user to change it. – mlepage Jan 21 '17 at 15:43
  • 2
    Looks ;like it is taking the first five letters. Mine is `aksha` – DollarAkshay Oct 27 '17 at 21:50
  • 2
    I'd rather have my initials than this. At least my initials are still *me*. – SherylHohman May 22 '18 at 22:55
  • 7
    Geeze DOS at least allowed **8** characters! And even a dozen characters is *nowhere near* 250 *!!* What about the option to choose which 5 chars would make sense ?? – SherylHohman May 22 '18 at 23:21
  • 1
    @MegmetFide - Please don't misuse words in English. It is not a bug, because the code that creates the profile name is not "produc[ing] an incorrect or unexpected result, or to behave in unintended ways", from the designer preservative (per https://en.wikipedia.org/wiki/Software_bug). It is undesired, but not a bug. – user66001 Apr 18 '19 at 13:50
  • As a side note, I wouldn't do the search and replaces with regedit. On my fresh windows install there were 180+ occurrences in my registry, so I'd recommend a registry editing tool like http://registry-finder.com/. (Note I am not affiliated with this tool) – travisjayday Aug 10 '19 at 19:34
  • 2
    yah whoever decided this is ridiculous. MANY of us use the command prompt so of course that would be annoying. – wesley franks Feb 01 '20 at 03:37
  • 2
    2021 and this still annoys me. – AlexioVay Jan 15 '21 at 14:26
  • August 2021 and the code still produces the "unexpected result" of giving me a user folder I never asked for, i.e. it's still a bug :] – Alex Wally Aug 03 '21 at 00:06
  • 1
    September 2021, I still see that happening on windows 10 Home OS Build 19042.630 – Mahesh Jamdade Oct 10 '21 at 16:07

10 Answers10

230

Microsoft has actually documented a very simple and clean way to rename a user profile folder.

EDIT Feb 2022: If you plan to use winget to manage your Windows installations at any point, note that Microsoft now warns against using this procedure under Windows 10 or later as it can stop winget working. Information about winget

There is no need to create a new user account, so all the settings associated with the existing user profile are preserved. And the only registry change required is to edit a single string value (the one that tells Windows the path of the user profile folder):

  1. Log in by using another administrative account.

Note. You may need to create a new Administrative account at first.

  1. Go to the C:\users\ folder and rename the subfolder with the original user name to the new user name.
  2. Go to the registry and modify the registry value ProfileImagePath to the new path name.
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\<User SID>\

That's it!

The procedure quoted above was provided by Microsoft (here) in relation to a perceived issue with Windows 7, and continues to work in Windows 10.


Notes

<User SID>

The ProfileList registry key contains a number of sub-keys. To find out which one to change, click on each sub-key and examine the values, to find the sub-key with the right ProfileImagePath:

enter image description here

For example, let's say we want to get rid of the space in a user profile folder name. So in step 2, we use File Explorer to navigate to C:\Users and rename the John Smith subfolder JohnSmith. And in step 3, we click on the <User SID> sub-keys until we find the one with ProfileImagePath C:\Users\John Smith, and change it to C:\Users\JohnSmith.

Administrative login

You may find you have to restart instead of just logging out and logging back in. Otherwise, when you try to rename the folder, Windows may report that it is being used by another program.

Environment variables (info)

Some applications create env vars with the user profile path fully expanded, so it's advisable to check for these and reboot if any needed fixing.

Reg Edit
  • 4,671
  • 2
  • 17
  • 35
  • This solution totally work. Thanks alot. But if you use linux on windows, you need reinstall linux that run on top of windows. – Pamungkas Jayuda Jan 16 '19 at 08:50
  • 37
    This should be the accepted answer. On Windows 10 1809 you have to do another step with OneDrive. When you log in you'll be told ...Desktop cannot be found, moved or deleted. You'll have to re-sign into OneDrive and let it sync with the new folder change. I also went into OneDrive Settings -> Auto Save and tapped "Update Folders" just to make sure Desktop was being properly picked up. After a short few minutes it seems that everything fell back into place. – Daniel Jackson Feb 15 '19 at 19:12
  • 9
    This simple procedure works well. Many software cannot be uninstalled afterward though. To correct this, you have to change all occurences of the former username in the registry. Luckily regedit has a search feature, unfortunately it has no replace feature so it can take a while to do it manually. – Futal Mar 14 '19 at 11:20
  • 2
    It worked, but this local user's system search under Windows 10 1903 was broken and did not yield any results from within system settings anymore. – der Michi May 29 '19 at 20:21
  • 15
    To avoid a ton of manual registry changes, "Unlink this PC" In OneDrive before doing this change-over. Then set up OneDrive again. – Ian W Aug 26 '19 at 13:28
  • 1
    @Reg Edit I am unable to even rename the folder. I shut down and login as the other Admin, and it says the folder is still open and will not allow me to rename it. – likejudo Sep 03 '19 at 00:46
  • @likejudo maybe you have something running on start-up? You can easily see what has it open using a Sysinternals utility. Download from this link and then from the command prompt enter "handle c:\users". https://docs.microsoft.com/en-us/sysinternals/downloads/handle – Reg Edit Sep 03 '19 at 19:03
  • 5
    Followup on this, as of December 2019 (1909 edition). I enabled the local Admin account with *net user "Administrator" /active:yes* and then logged in as Admin. Since my main user account was active, I had to open Task Manager and choose the Users tab. From there I was able to log out of the other session. Then, I was able to change the folder name and make the registry entry change. When I rebooted, I had to force Windows to log in as the main account, not the Admin account. Once back in my main account, I disabled Admin again with *net user "Administrator" /active:no*. – Eric Cloninger Dec 27 '19 at 20:31
  • 3
    I can't believe how easy it was - especially after following some tips from the comments above. I've searched the whole registry (remember to select "Computer" before performing a search, so that it scans the whole registry) and I found a total of 6 instances with the old user account name and 4 of them were paths to the profile image (it's a fresh installation of Windows though). Unlinking OneDrive was also a great idea, as it was very easy and after the restart, it linked itself back automatically once I opened the OneDrive app. – pafflick Feb 29 '20 at 19:06
  • 1
    so, as of April 2020, is this last comment by pafflick the sure-fire way of this method with minimal registry edits? if so, i think a new answer/edited answer that incorporates all of these very crucial additions would be a very good idea. – EarthToAccess Apr 10 '20 at 15:47
  • 2
    **Pre-step**: Unlink this PC on OneDrive. **Post-step**: search for Users\oldname on regedit. I found several keys with the old pathname ("last used source", "landscapeImage", etc.). There were a few keys related to onedrive, etc. that I could not modify. **Issues**: so far the only issue was that Dropbox stopped working. I uninstalled and reinstalled it. – Paulo Merson May 17 '20 at 14:23
  • 1
    I kept getting the "operation cannot be done because the folder is in use message" in Step 2, so i had to open up the resource monitor > cpu > associated handles and in the search box type in the old "user" name .. and then click "end process". only then i could rename the user folder – Oneezy Jun 30 '20 at 03:11
  • I did the recommended "Unlink this PC in OneDrive", including rebooting between steps to ensure when I did the other steps as a local only admin user ensured any sessions and files were closed and the other user was logged out but this still didn't work for me. I ended up after reboot a OneDrive prompt at login "Location Not Available - c:\users\jerem\OneDrive\Desktop is unavailable", will try unlinking and linking again... – netweb Jul 12 '20 at 05:51
  • 21
    If it's this simple, why the heck does Microsoft not add a "Change user directory name" to the user configuration application? – Luke Hutchison Oct 09 '20 at 05:17
  • I forgot to log off from OneDrive, and it was no issue: there was an error of a missing PATH at first start, then I simply uninstalled it using the windows menu and installed it again by asking for OneDrive in the Windows menu and logged in again. – questionto42 Dec 05 '20 at 11:16
  • I also had issues first with the other account being still active, see @EricCloninger. Windows 10 v20H2 where you have to login in Windows with a Microsoft e-Mail account. When trying to change the folder name, a message said something like: "The action cannot be finished since the folder (or a file in it) is opened in another program. Close the folder and repeat the process." When shutting down the notebook, "the pc was used by another user ...". I somehow managed to close the other account when I force-restarted it twice even though the other user was active (though it was not). – questionto42 Dec 05 '20 at 11:20
  • I mere detail: all of the taskbar icons were gone after this. And there was an unimportant remaining empty DropBox folder (while the relevant DropBox folder had been moved correctly) in the AppData folder of the old user folder so that the old folder still existed. You can just delete the old user folder manually then. No re-install needed, in contrast to @PauloMerson's comment. – questionto42 Dec 05 '20 at 12:10
  • This may be helpful for others: **If you can't change your username** folder (even with cmd.exe run as admin), create a new window user. Set him as Administrator. Log into him. Restart, because your main account will still count as active. Rename your C:/Users/oldname to the new username you want. Log in to the old account, follow steps in this answer. – AlexioVay Jan 15 '21 at 17:14
  • 6
    I don't think this is a "clean" way to rename. It is just a workaround on MS support web page. It's very worth mentioning that you still leave lots of registry containing your old user name; some are even unable to be changed or removed. So, change it early or live with it. It's pain any way. – Kirk Jan 23 '21 at 17:49
  • Note that if you have File History enabled, it will continue to use the old username. In order to rename the folder in the File History drive, you'll have to create a new File History (as least as far as I can tell). – thdoan Feb 10 '21 at 00:04
  • Update: even after setting up a new File History, it's still using the old username -- how do you get it to recognize the new username when it creates the folder? – thdoan Feb 10 '21 at 02:17
  • 2
    I tried this on Windows 10 Pro, 20H2, 19042.867 and upon logging into the account again it spins for a bit and says it can't log me in so it signed me into a temporary profile, had to revert to get it working again. – MetaGuru Mar 25 '21 at 14:17
  • Tried this on Win 10 Pro 10.0.19043.1052 and I could not open Start Menu. It told me "we will try to fix it next time you log in" but it never did. I ended up doing it via the _local account_ method above. – Qwerty Aug 16 '21 at 13:03
  • 5
    DON'T DO THIS! There are many more registry keys that need to be changed after. For me the search in Settings stopped working for example. Checked the registry and there were 70 keys and values still pointing to the old folder. Spent a good part of a day fixing all of those. – Tamas Hegedus Aug 19 '21 at 10:52
  • This literally makes no sense that you need to sign in as a different user to change YOUR user folder. This is totally backwards. – Timothy Pulliam Sep 17 '21 at 12:22
  • 1
    As others commented already, this is NOT WORTH IT. Many applications broke. A lot of other registry keys were pointing to the old directory. – Julio Batista Silva Oct 06 '21 at 03:10
  • 1
    You also need to run `netplwiz`, click "Properties" for your account, and update the `User name` (which affects `%username%`) – nirvana-msu Nov 08 '21 at 00:30
  • Worked great for me. Two comments: people should be reminded that after logging into the temporary admin account, you need to perform the rename from an elevated cmd window or app, and the only app I had that continued to try to use the old profile location was Dropbox. An uninstall/reinstall fixed that problem for me. – Michael Burr Dec 06 '21 at 15:49
  • Here's a comprehensive guide on this subject. Updating the per-user registry hives is an additional step discussed here → [How to Rename User Profile Folder in Windows](https://www.winhelponline.com/blog/rename-user-profile-folder-windows/) – w32sh Jan 22 '22 at 16:06
  • Yeah I spent many hours lining up my new username into the registry. Totally worth it for me. Very overwhelming for people who've never even had to look inside it though. – Keith Cronin Feb 10 '22 at 11:27
  • I had mixed results trying this method in several installations; sometimes work partially, sometimes screwed. Remember to [update the per-user Registry Paths (NTUSER.DAT & USRCLASS.DAT) and reset the Search engine](https://www.winhelponline.com/blog/rename-user-profile-folder-windows/). Having said that I gave up; I never, ever, install again Windows with a non-local account... – Marcelo Scofano Diniz Mar 28 '22 at 21:51
  • This messes with WSL, so you'll need to follow additional steps on fixing your WSL installation: https://superuser.com/questions/1626127/wsl-reset-after-windows-10-username-change – Ehtesh Choudhury Apr 29 '22 at 03:37
  • Other hints from someone who just successfully managed this: Microsoft Outlook can be tricky to start afterwards (you can't change the location of the outlook.ost file, as it's not in the registry). I would suggest moving it (using Outlook settings) to a location outside your user directory before the rename, and then into the new user directory after the rename. For updating the registry, I set up a few AutoHotKey scripts (which you have to load as admin so they work in regedit) to semi-automate editing the registry - one for unquoted values, one for quotes values, one for key names etc... – M_M Jun 13 '22 at 01:48
  • 1
    Renaming all the found occurrences in the registry is not enough. The path might be stored in binary data fields, encoded/encrypted, and/or could also be stored on disk in proprietary formats. A reliable way to avoid this is to create a symlink or junction for the old name that points to the new name. This ensures backwards compatibility. You can mark the link as Hidden if you want. – theultramage May 15 '23 at 13:49
205

This can be done without folder renaming and messing with registry:

  1. Create a local account with the user name you wish.

    • Local account creation is well hidden; here is how to find it:
      Settings > Accounts > Family & Other users > Other users > Add someone else to this PC > The person I want to add doesn't have an email address > Add a user without Microsoft account
  2. Change account type to administrator (can skip if there is other administrator).

  3. Remove original Microsoft linked account
  4. Link local account to Microsoft account if you wish
Journeyman Geek
  • 127,463
  • 52
  • 260
  • 430
voldemarz
  • 2,241
  • 1
  • 13
  • 5
  • 1
    Unfortunately this did not work out how I thought it would. Following these steps and then relinking my Microsoft Account created yet another User directory with my machine name appended to the end of it. – Andrew T Finnell Nov 02 '15 at 22:15
  • 5
    One caveat, if you use "Family safety" set up in your microsoft account, this can get very tricky at (4) if you want to do it for other family members. The other family members become "known" to the PC as soon as you convert the first account, and I hit a full-stop when converting the other local users . I had to disable that feature first, then add all family members as local accounts, then convert them to M$ accounts. – Ed Randall Nov 21 '15 at 07:56
  • 11
    Someone did an edit that seems more useful as a comment: IMPORTANT Be aware many application settings, video game saves, and so on are stored in the original user folder. (Rarely, some settings may even be tied to the old username). Your pictures, documents, music, and so on will still be in the old user directory. – Journeyman Geek Dec 28 '18 at 06:13
  • @DanielKaplan not exactly sure since haven't tried in a while and something may have changed, but probably something along the lines of this https://www.windowscentral.com/how-link-your-windows-10-product-key-microsoft-account – voldemarz May 22 '19 at 13:19
  • 3
    @JourneymanGeek IMHO it's a core part of the answer in that it's *not* renaming, but instead creating a *new* user. So the notice that *your original user folder is where everything still is* is very important. – Nick T Sep 04 '19 at 03:24
  • 3
    A step is missing between 2 and 3: log off with the old account and log on with the new account. – CarLaTeX Nov 16 '19 at 07:29
  • @CarLaTeX Isn't that obvious that you need to be not using an account when removing? These are not dummy-proof steps, but generic description of actions for someone who knows his way ardound Windows. – voldemarz Nov 17 '19 at 11:54
  • @voldemarz Yes, it is obvious, but when I did it I had a moment of uncertainty between the two steps (however, I upvoted because I succeeded in changing my user name with your answer). – CarLaTeX Nov 17 '19 at 12:12
  • this username trim is annoying and it still there on win 11 shame – buncis Oct 16 '21 at 11:53
  • In case anyone is wondering, there is a tool that lets you essentially "flash" a user's account data, into another user account. All of the data. It's called User Profile Wizard by ForensiT. We used it successfully many times in IT. It's free for non-corporate use. – Katastic Voyage Dec 23 '22 at 00:45
77

While not a direct answer to the question, a symbolic link can be a risk-free solution if the problem is not just aesthetics, but that restored or legacy configuration files or links refer to the user directory.

  1. Open an elevated command prompt
  2. Change to the user directory
  3. Create a directory junction targeting the real name of the user directory

e.g.,

C:
CD\Users
MKLINK /J Jeremy jerem

This enables you to use c:\Users\Jeremy\..... to refer to parts of your profile.

Kitiara
  • 871
  • 6
  • 2
  • What exactly do you mean by "Change to the user directory"? Do you mean inside "users" or inside "" or outside both? – Xonatron Jun 11 '17 at 16:48
  • 3
    This worked. Thanks so much for this suggestion. I opened CMD with admin privileges, navigated to c:\users\, and ran "mklink /j matt matthew" (for example) to link "matt" to the already existing "matthew" folder. – Xonatron Jun 11 '17 at 16:52
  • A great way to not have to change git source paths when working from work and home via cloud. – sfxworks Jul 25 '17 at 15:52
  • 6
    In my case it helped me surpass some errors a program had because my user folder has an space in it. So I ran `mklink /j greatUser "My Full Name"` and it works. Thanks! – Metafaniel Aug 10 '18 at 17:26
  • This will not change the value when I run commands like `whoami` on cygwin or my default SSH username. – SOFe Mar 25 '19 at 06:34
  • 3
    WARNING: Some programs will not follow a directory junction, and will crash as a result. – user66001 Apr 18 '19 at 14:01
  • 6
    Warning for Linux user : the arguments are **not** in the same order as for `ln -s`! – Eric Duminil Apr 28 '19 at 19:33
  • 2
    This is a nice answer to add to the [more comprehensive solution](https://superuser.com/a/1346983/113083) from @RegEdit. Specifically, I used that solution, and then I created a directory junction so that applications could access the user directory under the old name if they wanted to do so. Without the directory junction, I would have needed to reconfigure a lot of applications and perhaps to edit the registry. – user697473 Dec 04 '19 at 18:07
  • I did what @user697473 suggests but in reverse, I created a directory junction to my new desired directory name, then updated the above registry key. Has been working without issue, and has not required me to create another account (which is a requirement for the solution from @reg-edit). – peteykun Aug 22 '23 at 09:33
54

I had the same problem and I have solved it as follows (using information that I found on a few other websites):

  1. Just to be safe, create a restore point. Open the Control Center, type in System Restore and click on Create System Restore Point. Select the C: Drive and click on Create.
  2. Click on the Windows Button (at the bottom left), type regedit and click on Execute command.
  3. Confirm the UAC dialog by clicking Yes.
  4. Make a backup of the prior registry by clicking File > Export.
  5. Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList. There you can find a few subfolders (starting with 'S-1-5-'). Search for the folder that contains the path (that you want to change) in the registry key named ProfileImagePath. (Example from the question: search for the value 'C:\Users\jerem').
  6. If you have found it, double-click on it and change the path. (Following the original question, you would now change the value to 'C:\Users\Jeremy').
  7. Close the Registry Editor window.
  8. Click on the Windows Button (at the bottom left) again and type netplwiz and click on Execute command.
  9. Make sure that the checkbox 'Users have to enter username and password' is checked. Select the user (for whom you want to change the path) from the list and click on Properties.
  10. Change the user name in the new window. (Following the original question, you would now change the user name to 'Jeremy'). You can also change the full name here, if you wish (but in my case the correct name has already been entered). I suppose that you can not leave the full name field empty. Close the window by clicking OK.
  11. Close the other remaining opened windows also by clicking OK.
  12. Restart the system.
  13. Start Windows 10 again and try to login. This will fail (because of the changed path) and you will automatically be logged in with a temporary user account (which will take a bit of time). However, you can now change the name of the folder using the Windows Explorer (following the example above, you would now rename the folder jerem to Jeremy).
    Note: alternatively, you can boot into a second operating system (if you have one installed) or use a Live CD operating system to change the folder name.

UPDATE: Thanks to user @lmiguelvargasf for informing me about an issue with my solution! I thought that the system would be a bit more intelligent in updating the references in the registry, but it is not! Therefore you should start the Registry Editor again (as in step 2) and make a backup by clicking File > Export. Then click on Edit > Search (or Find...), type in the old path (in the example it would have been C:\Users\jerem) and search for keys, values and data. Replace all references containing the old path (C:\Users\jerem) with the new path (C:\Users\Jeremy). A click on the key F3 searches for the next reference. Repeat that until you don't find any references to the old path. Even with a relatively fresh installation on Windows 10, you might have to update about 100 entries (especially OneDrive and Edge have quite a lot of caching paths in the registry). And also some additionally installed programs might have created registry entries!

Finally, restart the system again and start Windows 10. The first login could take quite a while, but everything should now work fine again and the path of the user directory should now be changed! If everything works fine, you can now delete the original folder (the folder named jerem, using the example of the question).

INFO: I am working on a German system. I tried to translate the bullet points correctly, but it is very likely that they might be named a bit different!

DISCLAIMER: This solution is working on my laptop after upgrading from Windows 8.1 (64-bit) to Windows 10 (64-bit). However, I cannot guarantee that this solution might also work for others with other configurations. If you follow the solution provided above, you are doing everything at your own risk!

Shimmy Weitzhandler
  • 3,480
  • 15
  • 43
  • 65
traintes
  • 657
  • 5
  • 4
  • 1
    This worked for me on Windows 10 64-bit! After doing the 11 steps, to get to the temporary account, I had to put in my password, then my PIN, and keep pressing "skip" after Windows reported that there were some errors until it finally logged me in. After renaming the folder I restarted Windows and everything worked perfectly – Jorge Luque Aug 02 '15 at 08:41
  • I tried not putting in a "full name" and was unable to make this work, after putting in full name this worked fine. – jidar Aug 04 '15 at 05:40
  • @jidar: I suppose that the full name in step 9 is a mandatory field. However, (in my case) the correct name was already filled in and therefore I did not alter it. – traintes Aug 05 '15 at 07:41
  • 8
    This will work, but it will break several things, including the ability to install apps from the Windows Store. After checking the Event Viewer I noticed a number of errors related to the ESENT service, which were still referencing the old user account folder. The easiest way I found to solve the problem was by creating a symbolic link from the "wrong/original" user profile folder ("xavie" in my case) to the "new/correct" one ("xavier"). For this I used the awesome [Link Shell Extension](http://schinagl.priv.at/nt/hardlinkshellext/linkshellextension.html). – xfx Aug 07 '15 at 05:30
  • @xfx: As I mentioned in the post, I did not encounter any problems/issues up until now (following the steps provided above). Also I don't have a problem when trying to install something from the Windows Store - it just works as expected. However, I had to do some smaller things afterwards (e. g. confirm my account again, etc.). – traintes Aug 08 '15 at 08:26
  • 1
    @traintes: your solution has worked for me, but I have had trouble with Android Studio because it was installed before I rename the username. What worked for me after following your steps was to change every `oldusername` in the Registry Editor to `newusername`. – lmiguelvargasf Aug 15 '15 at 22:24
  • @lmiguelvargasf: That's a good tip, actually! I have done this steps with a rather 'clean' system (with just a handful of programs installed) and didn't run into any issues. However, I suppose that every program handles this issue differently. Maybe I will include this also in my answer (as a last step) - so what did you exactly search for? I mean did you search for *olderusername* only or for *C:\Users\oldname* to replace? – traintes Aug 16 '15 at 23:09
  • 2
    @traintes: I just looked for `oldusername` and in the search I included old keys, values and data that contained the word. – lmiguelvargasf Aug 17 '15 at 03:35
  • 4
    Be careful during the registry search and replace. You don't want to accidentally double replace "c:\jerem" with "c:\Jeremy" or you could end up with a "c:\Jeremyy" somewhere. In fact, you might want to search for that afterward just to be sure. Also, there may be some other programs which store the paths elsewhere, such as an .INI file, .XML file or a database. Expect something to break and be prepared to hunt it down. – GuitarPicker Aug 17 '15 at 15:46
  • @GuitarPicker: Therefore I suggested to make a registry backup before you use search and replace. And yes, it is definitely possible that some paths are stored in INI files, databases, etc. - but I think that most programs will use relative paths and the USERDIR variable. However, I also suggested that you do this on a clean system - then you have the assurance that only Edge and Skydrive have paths in the registry! – traintes Aug 19 '15 at 20:13
  • I was hoping this would simply change the path name while keeping all user settings and program installations / settings. This was not the case though, so I might as well have created a new local user with the desired name, then connect it later with the microsoft account as described in other answers – Alex Aug 26 '15 at 14:35
  • Even after all this, I've found that the Windows Store breaks after the change. I think I'll end up just making a new Local account and using that instead. – alanaktion Nov 19 '15 at 06:49
  • In final step 13., it is safe to delete any new temporary User account that was made following these steps, I think, right? – cellepo Jan 09 '16 at 23:02
  • Can't the content of the UPDATE (per @lmiguelvargasf) to this Answer be done in between 6. & 7.? – cellepo Jan 09 '16 at 23:05
  • @cellepo 1) It is safe to remove the temporary user after restarting the machine AFTER step 13! 2) I do not think so, but I haven't tried it. However, I suppose that other programs might cause problems (e. g. while logged in with the temporary user), because if you already update ALL registry entries between steps 6 & 7, then the registry would then contain paths that do not exist at that time... – traintes Jan 11 '16 at 00:54
  • As a warning to all, this method screwed up OneDrive for me. The fix was to download the installer (for Windows 7/8, since there isn't an installer for Windows 10), and use it to set OneDrive back up from scratch. All my files were still there of course. – Nicu Stiurca Mar 28 '16 at 18:02
  • 6
    To keep the system in a continuously sane state, I'd recommend (as @xfx did) that you create a symlink from the new name to the old one before making changes. Right-click the Start menu and open Command Prompt (Admin). Then `cd C:\Users` and `mklink /D newname oldname`. Once you've rebooted and ensured that nothing refers to the old name, you can delete the symlink and rename the directory. – Trevor Robinson May 15 '16 at 20:39
  • Another warning to all: When I did this it broke Cortana. I could no longer launch apps by hitting the window key and typing (only some of them would be found, but most would not be). I haven't figured out how to get my machine back to a stable state. Might have to reinstall. Don't do this. -1 – JMarsch Jan 08 '17 at 23:51
  • Follow-up: In the end, I used the voldemarz's answer. I had to create a local account, delete my old account (lost all my app settings), and then re-create it and re-link it. So far, everything seems to be working (I'm just living with the default folder name that windows gave me) – JMarsch Jan 10 '17 at 17:24
  • 1
    Note that for search and replace, a program that has an actual find and replace tool is helpful. I used https://sourceforge.net/projects/regedt33/ and it worked well. – Venryx Apr 18 '17 at 17:59
  • Worked great. My only hiccup was after changing the registry in the early steps, the start button wouldn't allow a search, so couldn't run netplwiz from the start button. A quick search form the c: drive found netplwiz.exe in c:\windows\system32, so ran it by just double-clicking on it. Also, already had a second account on the machine (my wife's) so could use it to rename the folder. – buttonsrtoys Dec 23 '17 at 14:34
  • One could find 3rd-party non-registry config files which need to be manually updated using the 'Everything' search application with a query like `ext:ini;xml;cfg content:oldAccountName` – lukeuser Aug 27 '18 at 18:36
  • When I tried to change the name of the folder using Windows Explorer, it gave me "This folder is being used by another application" error even though I closed all the apps (background too) – Samleo Apr 13 '19 at 02:33
  • This helped me the most due to the instructions around **netplwiz** which was missing from the higher ranked answers. This ensures your username shows correctly in some apps, network, or folder sharing (such as `COMPUTERNAME\UserName`) – Mark Apr 14 '20 at 02:27
  • This does not work any more on Windows 11. Step 9's checkbox 'Users have to enter username and password' is checked. is no longer present. It does log in with a temp-user, but takes very long (10 minutes?) and I am able to change the directory name, but after restart I am not able to log into my user account. – isgoed Apr 14 '22 at 20:16
30
  1. To access the Advanced User Accounts panel type netplwiz in Search the web and Windows box next to your Windows button then click or tap on Netplwiz (Windows application).

  2. In the Advanced User Accounts panel, select the user you want to modify and click Properties

  3. In the properties window for the user, enter the new user name and click OK.

  4. Restart for the changes to take effect.

Source: http://www.opentechguides.com/how-to/article/windows-10/43/win10-change-account.html

I say Reinstate Monica
  • 25,487
  • 19
  • 95
  • 131
Jp_
  • 447
  • 4
  • 8
  • 8
    The question is about changing the profile folder name, not the user name. Does your solution work for that? I doubt it... – zagrimsan Dec 09 '15 at 13:26
  • 2
    I was searching for ´netplwiz´, because I want only rename my username. – hdev Feb 25 '16 at 17:06
  • 5
    Your link is updated and now includes how to change the Folder name too. And this other link includes 2 methods (onr for Local Account and other for Microsot Account) to change the UserName and then change the Folder name: http://answers.microsoft.com/en-us/insider/forum/insider_wintp-insider_security/rename-user-account-folder-in-windows-10-preview/88033eca-6b32-47c5-90ac-a5e7af17d094?page=1&auth=1 – Troglo May 13 '16 at 20:42
  • 2
    This actually helped as much as the accepted answer: for some reason, Windows wouldn't let me create a local account with the name I wanted (probably because I already tried switching from my ms account to a local account so the name was still registered somewhere), but using netplwiz and the advanced user account mmc, I managed to do that with far more ease than by using the "normal" local account creation! – Melvyn Jul 24 '16 at 12:40
  • 1
    This should be the accepted answer. I tried this method while logged in with a Microsoft Account for which I wanted to change the user folder name. After changing the account name in netplwiz AND rebooting the computer, surprise, the folder also got renamed. Tried and tested in WIN10 v1809 – Ivan Feb 24 '19 at 12:27
  • Tried in Win11 21H2, did not result in renaming the user folder. – Nathan Reed Aug 14 '22 at 17:53
2

There is a much faster and easier way. (As usual, Windows NT got it right, but Microsoft just keeps making trivial UI tasks harder and harder as they try to cater to the fringe tablet market. Luckily the old apps are still available.)

Open the Start menu, type comp and select Computer Management, expand Local Users and Groups, right-click Users to a new local account there, then click Groups and open the Administrators group and add the new account.

Log off, log in with the new account. The account name will be used to create a new folder in Users. You can copy whatever you need from the old user folder, then delete the old user account from the same app (or that "Family" thing in Settings). Re-link to your MS account if you wish.

McGuireV10
  • 331
  • 4
  • 10
  • 2
    Unfortunately the `Computer Management > Local Users and Groups` option is not available in Windows 10 Home edition, only in Professional and above. – Salvador Sep 05 '18 at 11:14
2

I had the same problem and this worked. Thanks to tenforums website!

https://www.tenforums.com/tutorials/89060-change-name-user-profile-folder-windows-10-a.html

Summary:

1) in a command window: wmic useraccount get name,SID

get the SID for the user.

2) Open registry using regedit command.

search for

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\

edit local user name to new name.

3) Important: after editing the registry you must restart your computer otherwise the rename will give the same error.

4) Now you can rename the directory (folder).

likejudo
  • 361
  • 2
  • 3
  • 9
  • 1
    Please quote the relevant content so your answer is complete. – Daniel B Sep 04 '19 at 14:40
  • @DanielB it is several pages long and has screenshots etc. – likejudo Sep 04 '19 at 15:38
  • 1
    If (more like when) the page you linked goes away, your answer is suddenly not an answer anymore. That’s of no help to anyone. If you feel like the guide is overly detailed, you can also try to shorten it. – Daniel B Sep 04 '19 at 17:34
  • These are the same instructions as an existing user. – Ramhound Sep 04 '19 at 22:59
  • @likejudo - I still believe this answer is suggesting the same solution that already was submitted minus looking up the SID of the user which I believe isn’t necessary. Any event you still have not quoted the relevant information as required by our rules. If you copy a source from another website it must be cited (which you have done) and quoted (which you have failed to do). – Ramhound Sep 09 '19 at 11:28
  • This was the solution I followed, using the link. The summary could be more detailed, but the linked procedure had screen shots that were helpful (or at least calming) while working through white-knuckle registry edits and OneDrive goofiness. I would include how to get SID in the summary: wmic useraccount get name,SID – wistlo Jun 27 '22 at 15:26
1

The other answers are quite useful but I'd like to add that many many things including the ability to uninstall any programs that were locally installed will be broken until you properly migrate all your registry keys and values.

I used Registry Finder, first replacing "Users\oldusername" in keys and values, and then replacing non-binary data fields. There were some errors but it mostly worked. I tried to review what was being edited, but there are thousands of entries so I had to skim. They fortunately group up so that you can skip similar entries when reviewing.

Manishearth
  • 1,206
  • 1
  • 13
  • 25
1

I can't comment yet... I just wanted to add that I followed the steps from traintes' solution, but if you want to avoid getting the error when restarting the pc, you can follow these steps before restarting:

  1. activate the Administrator account from command prompt (with admin rights) right clicking on the windows logo and selecting the option and typing net users Administrator /active:yes
  2. reboot the computer in Advanced Startup clicking on Start > Power > (shift +) restart
  3. Go to Troubleshoot > Advanced Options > Command Prompt
  4. Select the Administrator account
  5. Navigate to C:\Users typing c: then cd users
  6. Type rename oldname newname using your current folder name instead of oldname and the desired folder name instead of newname

exit and reboot... easy peasy...

SherylHohman
  • 1,157
  • 9
  • 18
TonyMorello
  • 149
  • 1
  • 6
  • 3
    You are restarting the computer as often as in my guide (twice). However, following your steps, you are saving a bit of time as you don't have to be logged in with a temporary profile (which takes a bit of time to create)... – traintes Aug 27 '15 at 15:48
  • Have you tested these instructions? At least in prior versions of Windows, because HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\\ProfileImagePath will still be pointing to c:\users\oldname, Windows will just assume the folder has been deleted and recreate it when you next login. You should also find that because you are logged in as oldname, ntuser.dat will be open and prevent the renaming of the directory. Finally, you should also advise people disable the administrator account as the final step; There is a reason it is disabled by default! – user66001 Apr 18 '19 at 14:09
  • On step 5 there could be assigned other letter to system drive, not C. In my case it was D. So it is better to check other letters if your folders are not present on C in this troubleshooting cmd – Andrey Kuznetsov Dec 31 '20 at 04:16
  • Tried all the other methods in W10. But, as the folder was locked once Windows started, following this steps were the only solution! – Thremulant Mar 01 '22 at 18:48
-1

I managed to get that Windows 8 tutorial to work for myself by logging into the second admin account in safe mode (I used "Safe Mode With Networking" myself; the precise methods used to get your version of Windows 10 into Safe Mode may be different). Safe Mode prevents OneDrive from loading, among other things.

After renaming the directory, you'll need to search and replace "C:\Users\jerem" to "C:\Users\Jeremy" (in my case, it was "C:\Users\Kimiko" to "C:\Users\Muffin") in Regedit while you're logged into the secondary account, and then you'll need to do it again once you've logged back into your main account so you can get everything in HKEY_CURRENT_USER as well. This won't catch everything in files, obviously; when I rebooted after doing the second search and replace, OneDrive complained that its home directory had been deleted, among other things. Everything seemed to work after that, though.

  • You haven't run into the TextHarvester.dat issue? – GollyJer Jun 09 '15 at 01:20
  • 1
    I have not, but it occurred to me when I was checking just now that this might because I'm using it on a desktop machine and have never had a touchscreen attached. In which case I would *guess* you could go back into Safe Mode after following my instructions, and then do the `DelProf2.exe /u` thing. – Dizzy H. Slightly Voided Jun 09 '15 at 15:17