I have an old Windows installation on a secondary HDD and I can't format it because there's data on it.
I therefore want to delete E:\Windows
but haven't got sufficient rights.
So I first took ownership of everything:
takeown /R /D Y /F windows
Then I modified the ACLs to default:
icacls windows /reset /t /q /c
And then I deleted:
rmdir /s /q windows
But actually, icacls already failed on 6 folders.
windows\CSC\v2.0.6\namespace: Access denied
windows\CSC\v2.0.6\temp: Access denied
windows\CSC\v2.0.6\namespace\*: Access denied
windows\CSC\v2.0.6\temp\*: Access denied
windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\Ngc\{DF2A28A6-5B19-4958-B762-2AB0124EA99D}: Access denied
windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\Ngc\{DF2A28A6-5B19-4958-B762-2AB0124EA99D}\*: Access denied
(So now this is everything which remains in E:\Windows
. Just to be sure, I also tried icacls windows /grant Felix:F /t /q /c
which didn't help. But I checked and I am indeed the owner.)
So what are my options?
The answer doesn't have to involve the command-line. If there's a shell way to do it, that's just fine.
Windows.old
folder after a Windows 10 upgrade: How to force the deletion of a locked file that has no locking handle on Windows?