Deleted a user, but the folder remains & it's locked - how to delete?

  1. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535

    Deleted a user, but the folder remains & it's locked - how to delete?

    I created a test user account, but it's no longer needed, so I wanted to delete it. I deleted it under settings>accounts>family & other people. It said it would delete all data, but it did not delete the user folder. The user is no longer available, but it left the folder behind. I tried deleting it after a reboot, but it says it's locked by NTUSER.dat.

    How can I safely delete this folder? I'm guessing I should be able to delete it? Why is it even locked now?

    I do have a program called "delete invalid file (DelinvFile)" that allows me to set a file or folder to delete at boot, but I wanted to verify this is safe before I do it.

    From what I've read, depending on how you delete a user, sometimes it leaves the folder behind. Typical Windows.
    Last edited by rivre; 27 Jun 2018 at 23:55.
      My Computer

  2. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter

    To add to this, I tried following the instructions here to delete the leftover folder:

    How to Delete Windows 10 User Account and Profiles? - Technig
    How to Remove User Profile Correctly in Windows 10? - Technig

    (using sysdm.cpl - SystemPropertiesComputerName.exe) but when highlighting the "account unknown" entry, the "delete" button remains greyed out. I also tried running "sysdm.cpl" under an Administrator command prompt, and it still left the delete button greyed out. User comments there say running sysdm.cpl under admin rights should allow the delete button, but it doesn't for me. I even ran "SystemPropertiesComputerName.exe" directly from the system32 folder as admin, and that profile is still greyed out. So now what?

    EDIT: I just went into the old user profile folder, and the only file that is locked is NTUSER.DAT. All other folders can be deleted manually. Can I safely set my "delete invalid file" program to delete this file at boot, or will there be issues?

    The thing is, I don't like that in sysdm.cpl it still lists the old deleted profile as "account unknown". What can I do do safely remove this user folder under sysdm.cpl? Why is delete greyed out? I'd rather not just delete the folder if "account unknown" will still be listed under sysdm.cpl properties. I'd like to delete this the right way so it's not an issue later but it won't let me.
    Last edited by rivre; 27 Jun 2018 at 23:53.
      My Computer

  3. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter

    I also read this which may be another way to "correctly" remove this old user folder:

    [SOLVED] What exactly does deleting a profile in Windows do? - Windows 7 Forum - Spiceworks - Page 2

    "Or just delete the key directly:
    In the “Profile Image Path” value. Find the key that lists that user. NOTE THE LAST 4 DIGITS OF THE KEY, Then delete it.
    Then find this path. HKLM\Software\Microsoft\Windows NT\Current Version\ProfileGuid and delete that one. (last 4 digits)"

    Especially notable is this comment further down:

    In fact if you delete the profile folder but don't remove it (using Sysdm.cpl), or regedit (HKLM\Software\Microsoft\Windows NT\Currentversion\ProfileList\ <User's GUID - click on them to see their username in the data>\), then everytime that user logs on in the future their profile will corrupt and they'll receive a temporary one.

    I've found the system properties deletion unreliable sometimes, so always manually check the directory and registry afterwards."

    So it sounds like I could just remove the proper key in the registry to safely remove the entry, then delete the leftover folder if necessary? I browsed to the registry keys this refers to, and I see the profile key for the deleted user (named C:\Users\test under ProfileImagePath).

    Any thoughts or help on this would be much appreciated. The easy way would be to use Sysdm.cpl but it won't let me.

    Edit: err, I don't have HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileGuid

    There's no entry at all for that. There's also no GUID entry in the deleted user's key above ProfileImagePath.

    I have HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Currentversion\ProfileList

    but not

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Currentversion\ProfileList\ProfileGuid.

    Don't know how to proceed. Maybe my home version of windows just doesn't have a ProfileGUID entry?
    Last edited by rivre; 28 Jun 2018 at 00:33.
      My Computer

  4. Posts : 426
    Windows 10 64-bit Ver 1909, OS build 18363.535
    Thread Starter

    Problem solved.

    - backed-up and then deleted the registry key for the deleted user in:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\Currentversion\ProfileList

    - Rebooted and then deleted the old profile folder, which was now unlocked.
    - running sysdm.cpl no longer shows the old deleted user profile.

    Thanks again Windows 10 for making what should have been a simple thing to do (delete a user profile) a major headache.
    Last edited by rivre; 28 Jun 2018 at 01:23.
      My Computer


Related Threads
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:53.
Find Us

Windows 10 Forums