Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a few folders that I can't delete:

enter image description here

I right-click > properties > security to try and give myself permission, but no joy:

enter image description here

So I try to take ownership of the folder in advanced > owner...

enter image description here

But no...

enter image description here

So I try running the command prompt as administrator and doing rmdir, doesn't work:

enter image description here

I've run out of ideas! How can I delete these folders?

share|improve this question
    
Where are these folders in the filesystem? Did you create them yourself? –  music2myear Feb 16 '12 at 17:02
    
Good point, they were created by a command line application. However, I've deleted many files created by the same application in the past - nothing different there. It's a code generation tool that creates several 'skeleton' code files across a few folders. –  greg84 Feb 16 '12 at 17:04
    
Have you tried deleting in safemode? –  Raystafarian Feb 16 '12 at 17:04
    
Good idea @Raystafarian - I'll try that - stick it on as an answer in case it works! :) –  greg84 Feb 16 '12 at 17:06

3 Answers 3

Take ownership and add permissions using the command line.

takeown /F (path to folder name) /R /D Y

(takes ownership)

icacls (path to folder name) /grant administrators:F /T

(sets full permissions for the folder to the admin group)

You should be able to delete it now.

share|improve this answer

There's always the live CD method of file deletion. It doesn't take too long, just a couple reboot's worth.

Download your favorite linux Distro (or use a tool such as Bart's PE or the Trinity Rescue Kit (TRK). My personal favorite is the Trinity Rescue Kit. It's got a lot of tools I use with some frequency.

Most Linux live disks by default prevent modifications to your HDD for protection, but they usually also have relatively simple ways of removing these protections to allow advanced file management on the hosts HDD.

share|improve this answer

Uah, I delete a lot of files via CMD line. This is sort of a work around, but run a CMD prompt as an Administrator (Right click > Run as Administrator) and then navigate to the file you want to (EX: cd C:\Users\Me\Desktop) and then type del filename (ex: del moo.txt).

share|improve this answer
    
Tried that, didn't work - got the "Access is denied" error you see above. I'm trying to delete folders, not files, so I needed to use rmdir foldername. –  greg84 Feb 16 '12 at 17:05
    
Ah, I just noticed that at the bottom. Are you an administrator on the machine you're doing this on? Is this machine a part of a domain? –  Ethabelle Feb 16 '12 at 17:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.