0

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.

5
  • You should be able to utilize a modified version of the same method I posted in a previous question, regarding how to delete the Windows.old folder after a Windows 10 upgrade: How to force the deletion of a locked file that has no locking handle on Windows?
    – Run5k
    Dec 16, 2016 at 3:24
  • Why the downvote? @Run5k I'll try that now. Dec 16, 2016 at 3:35
  • @Run5k It worked! As this question is different from the other, maybe make an answer here that links to the other? Dec 16, 2016 at 3:44
  • That may be a bit of overkill, since it is close enough to possibly be considered the same type of problem. If you simply want to up-vote the original answer, I will flag this one as a duplicate. Ultimately, I am glad to have helped in some small way.
    – Run5k
    Dec 16, 2016 at 3:56
  • I had hoped this would get an answer without logging out of windows. But it seems there are ACLs which not even the admin can change. Dec 16, 2016 at 6:46

0