Deleted my user account with command prompt

Landy005 1 Reputation point
2021-10-25T19:19:58.413+00:00

Ok so this is my w10 journey; i had a simple problem, my searchbar didn't work. I did all the powershell and cmd prompts lines suggested online, rebooted 50 times over the span of a week. No change. I was tired of this and wanted to check if i could do something in safety mode (which another article suggested).

Here is where it became tricky; safety mode requires you to log in with your REAL password, not my PIN. I was worried since i haven't logged in for years with my real password. Since i have my email linked i knew it had to be my outlook email account password, which didn't work. Strange... even more so when i went to troubleshooter and started command prompt or any other of those where you first have to login for, it DID accept my password. (so basically this is a bug where microsoft doesn't let you sign in with your password if you're not connected through a cable network, i'm on wifi so...) So thank god i had acces to command prompt, made myself a second account, could login and hop out of safety mode, which made me relogin my original account with just my PIN. Great! Back to square one.

But then..., I wanted to delete the account i made to get me back on my normal account so via command prompt i checked which accounts there are with "net user" and then i did "net user <myname> /delete"... to then find out i deleted my actual account instead of that backup i made 10 min earlier... here we go again.

I'm still logged in but slowly i realise half of my programs don't start because they lack permission, which is logical.. my user account is literally deleted. I checked in regedit and saw my old SID still there but had no clue on how to even get my account back. After a long time searching the almighty web and not finding anything that worked, i logged out & logged into my administrator backup account (i was also so done with not being able to open control panel and settings etc..). To see that my normal account is not even an option to log in to anymore. I don't have any recovery files because i'm living on the very edge of my computer with a constant 5-10 gb free on the c drive (yikes).

I see all my old files are still there under c/users... nothing is lost, not even 1gb. So i know there must be a way to get my account back to normal, right?
System properties still show my 'unknown account' with 19gb

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

still has my old SID

I now made a new account where i signed in with my microsoft account where my old account was made on. Maybe I can just assign the old user account to this one? I tried the profileimagepath and state in the sid (regedit) but that just made me not able to login that account anymore so i inverted it.

Does anyone know what i can do and what will work? What actually got deleted? What actually happens when you do net user ... /delete ?
I can live without a searchbar but without my whole profile that's a bit tough... i know you may think copying over all files to a new profile is the way to go but i've spend literally hours alone on some of those settings that will be lost like this person has said before;
https://superuser.com/questions/888292/recover-accidentaly-deleted-win-8-1-user-account-and-get-back-to-his-session-whi?rq=1
moving user account folder to another account will only give you back 80-90%.

Update:

Just found a 2 year old backup on some external hard drive of my whole entire c drive, can i do something with that? Knowing that back then my user profile still existed can i port a group of files or a profile over and match it with my current files that are left?

Windows for business Windows Client for IT Pros Devices and deployment Configure application groups
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,916 Reputation points
    2021-10-27T08:12:06+00:00

    Hi there,

    If you have SID you can duplicate it and recover the Profile.

    Click the folder on the left-hand pane that matches your SID.
    Double-click ProfileImagePath on the right pane, input the correct path for your user profile in Value Data.
    Double-click State on the right-hand registry pane, change the Value data to 0 and click OK.

    If you have made a backup with File History, you can follow the guidance below to recover deleted files.

    1. Type “file history” in the search box on taskbar.
    2. Select Restore your files with File History from the search results.
    3. In the pop-up window, choose the folder (C:\Users\ folder) that user profile usually located in.
    4. There may be different versions of this item. Find the version you’d like to restore.
    5. Click the Restore button to restore your desired version.

    --If the reply is helpful, please Upvote and Accept it as an answer--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.