Here is how to take ownership of a file or folder and then assign permissions for an account using the command-line. Windows includes a command-line tool named Takeown.exe, which can be used from an admin Command Prompt to quickly change the ownership of a file or folder.
Note that these methods should work on almost all recent editions of SQL server.
We will look at some of the easiest methods to find installed SQL server versions. If you find it under HKCU\Software\Microsoft\Installer\Products then delete all listed (It may have a random GUID, then Features, InstallProperties, Patches, and Usage) Then run the generic installer at