Hello,
In this case I would recommend to takeover ownership through commandline, following the next steps:
Step 1: Press Windows + R to invoke Run window.
Step 2: Input cmd and press Ctrl + Shift + Enter to run your Command Prompt as administrator.
Step 3: Type the command lines takeown /F Path (Path should be replaced by the actual path of the problematic file) and press Enter key to take ownership of the file.
Step 4: Type the command lines icacls Path /grant administrators:F and press Enter key to grant Administrators full control permission for the file.
If it still does not work, try:
- Run an image repair (recommended to run using a downloaded image, mounted) https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/repair-a-windows-image?view=windows-11
- Run a clean boot: https://support.microsoft.com/en-us/topic/how-to-perform-a-clean-boot-in-windows-da2f9573-6eec-00ad-2f8a-a97a1807f3dd
Last but not least, as a last resource you can access in Safe Mode as Administrator which would ensure that you don´t have any locks on the file or path.
------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept as answer--