1. Open Start menu and enter cmd in the Search box.
2. Navigate to your file's directory in the command prompt. ( e. C:\Files\myfile.exe)
Then type in the following command:
You should get a success message once this is completed.
SUCCESS: The file (or folder): "C:\Filesz\myfile.exe" now owned by user "ComputerName\username"
where
ComputerName = Your Computer's Name
username = Your user name
3. That will give you ownership of the file, but you still have no rights to delete it. Now you can run the cacls command to give yourself full control rights to the file:
cacls myfile.exe /G username:F
You need to substitute your user name in place of username .