I often get access denied errors because the file is in use by a process. I don’t know why the error isn’t more helpful.
If that’s not it, you can try recursively making all the files on the drive writeable with the attrib command:
ATTRIB -R -S C:\ /S /D
(Replace C: with the correct drive, of course)
The main reason behind this is that the explorer.exe process locks files that are in use, effectively preventing you from deleting them. Usually, these files should not be touched, but sometimes, situations arise when you really need to erase some troublesome ones.
Fortunately, there are a few easy solutions to delete those files.
Solution #1: Kill explorer.exe Solution #2: Use The Windows Recovery Console Solution #3: Use unlocker
More details and reference:
If you are the Administrator and you can’t delete the files on drive, that means the drive is “Read-Only”. meaning you don’t have write access to the drive.
You can verify this by right clicking on the drive and choosing
Properties > Security > Advanced > Edit. In that tab you can change the settings and allow “read/write” for the administrator or specific users.
You don’t have access to that files/folder. You should go to Properties -> Security -> Advanced and change to owner to your user (check subfolders if needed)