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


  1. Posts : 332
    Windows 10 64-bit home
       27 Jun 2018 #1

    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 ComputerSystem Spec


  2. Posts : 332
    Windows 10 64-bit home
    Thread Starter
       27 Jun 2018 #2

    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 ComputerSystem Spec


  3. Posts : 332
    Windows 10 64-bit home
    Thread Starter
       28 Jun 2018 #3

    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:
    
    “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsNT\CurrentVersion\ProfileList”
    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:

    "Yep.
    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 ComputerSystem Spec


  4. Posts : 332
    Windows 10 64-bit home
    Thread Starter
       28 Jun 2018 #4

    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 ComputerSystem Spec


 

Related Threads
Hi all, I'm not at the friend's place at the moment, but wanted to fly this by in the event someone else has had this issue & resolved it. PC is a HP Pavilion Desktop running Win 10 Home v1709. It's an upgrade from Win 7 and was running fine up...
User folder locked when defender->real time on in AntiVirus, Firewalls and System Security
Seems when defender->real time virus protection on, some software like iTunes can't access the music->iTunes fold.
How to delete USER FOLDER link in General Support
Have been using Win10 for about 6 months when a User folder icon appeared on the Desktop. No idea what I did to make it happen. I believe the Desktop User folder is a link to the C:/Users/file Adding or deleting a file in the C:/Users/file also...
Deleted user account but cannot delete all user files in User Accounts and Family Safety
I deleted the previous user account on a laptop given to me by my friend (Joanne) and changed it to a new name (Serena). This seemed to work and when when I login it is with the new username. However there seems to be contradicting info about user...
On build 10586 I noticed a new Desktop Icon: 'desktop' - solid yellow icon. No need for that on the desktop so I put it in the Recycle Bin and to my amazement a popup appeared - "This folder is too big to recycle, do you want to permanently delete...
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 05:01.
Find Us