Lost access to admin user account in my mac book pro

I changed Account name property on my mac book pro in System Preferences-> User & Groups-> Advanced Options. I attached a picture of then the window (Not my account window, now i cannot access Advanced options). After changing the property, My admin account changed to Standard account. Even thought i can log in using my login, i cannot do any admin tasks since it says my password is wrong. It was the only admin account i had. So how can i regain my admin priviledges. I highly appreciate your help.

ps: My mac book pro running on High Sierra.

enter image description here


You can recover the admin privileges easily by rebooting into Apple’s Setup Assistant tool. This will run before any accounts have been loaded, and will run in “root” mode, allowing you to create accounts on your Mac. Then, you can recover your admin rights via the new administrator account. After that, you can reboot into your recovered admin account and delete the interim administrator account.

Start up the Mac whilst holding down ⌘-S. After a few moments, you'll see the Mac boot to the command line.

/sbin/fsck -fy

/sbin/mount -uw /

rm /var/db/.AppleSetupDone

After that, simply enter reboot and your Mac will restart and boot normally. Only this time, Setup Assistant will launch. This will run before any accounts have been loaded, and will run in “root” mode, allowing you to create accounts on your Mac.