How to unlock and delete locked files and folders by changing their ownership
Sometimes, you can't remove or delete a file because you don't have ownership rights to do so, and here comes the obvious question, why don't I have the right to delete a specific file or folder? The short answer is that your files or folders may have been created in the past when you had a different operating system than the current one, so the files are compatible with that previous version of the operating system but not with the current version, so you must first give ownership through the installed operating system Currently on your device, and only then you can delete any private files with ease, just follow the steps as follows:-
Step 1. Choose the file or folder you wish to delete and right click on it.
Step 2. Select Properties from the context menu, and the file properties window will appear immediately.
Step 3. Go to the “Security” tab, and click on the “Advanced” button.
Step 4. When you go to the advanced security settings window, you will
discover the owner of the file under the name “Owner”.
Step 5. In
some cases, the OS name is written as the owner name, or other times it
appears as “TrustedInstaller”, however, now just click on the “Change”
button next to the owner name.
Note: TrustedInstaller is a built-in
Windows account responsible for removing and modifying updates and various
other essential components. So if you find the file owner name is
“TrustedInstaller”, it is best not to change or delete it; Because that
makes the file system more unstable, so change the name from
"TrustedInstaller" to something else. If you know exactly what you're doing,
be careful applying the steps.
Step 6. Inside the “Enter the object name to select” box, enter a new username and press “Check Names” to check whether it is ok or not, finally, click “OK” to save the changes.
Step 7. Go back to the advanced security settings and you will notice a checkbox named “Replace owner on subcontainers and objects”, simply tick this checkbox, click “Apply” to save the changes, then “OK”.
Step 8. Now exit the file properties window, and restart your computer.
Step 9. Now open the properties of the file you want to delete again by right-clicking on it, and choose from the “Properties” menu, then go to the Security tab, and then click on “Advanced”.
Step 10. Again, under the “Permission” tab, check the “Replace all child object permission entries with inheritable permission entries from this object” option.
Step 11. Next, click on the Edit button below it, and in the Permission window, select the Full Control option and click on OK.
Now try deleting the file or folder again, this time for sure the file will be deleted without any problem.
Antivirus is a
necessity in every computer, antivirus software contains many useful
tools and features that help protect files and folders from any virus or
malicious software, sometimes you will not be able to delete your files,
where there is another possible reason, which is that your Antivirus prevents deleting some files, if you are having trouble deleting your files, you need to check your antivirus software once, even this type of software causes problems and prevents you from deleting files and folders.