Can’t delete windows.old folder from inside .wim file

OK, so, some dumbass created this image without cleaning up the C drive first. I have taken this over at a new job, and, the .wim file we have to use for re-imaging is absolutely massive due to it…

I mounted the .wim file with DISM, and, managed to delete a few folders through windows explorer, however, some of the stuff in it just won’t delete.

The error I get is: “You require permission from TrustedInstaller to make changes to this file”.

And so I have to skip all of them which then leaves me with like 17 GB of files. I am logged in as a domain admin.

I’ve even changed the owner of the whole folder (and it’s 200.000+ files) to myself and given myself explicit permission over them, yet, when I now try to delete the folder, it says that I need permission from my own username to make changes to the file.

I’m logged in as the user that it is saying it needs permissions from, which is really weird.

If I try rmdir in an elevated command prompt it just says that access is denied.

Any thoughts anyone?

Host OS is 2008 r2. Don’t ask…

Answer

Well, it turns out that if I remove all permissions, and then just add my own user as the sole permission on the folder and its child objects, then I’m able to delete it.

Damn permissions!!!

Attribution
Source : Link , Question Author : user757392 , Answer Author : user757392

Leave a Comment