Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a folder called C:\cygwin. How can I delete this folder.

It says I need permission from the administrator. However I am logged in as administrator.

share|improve this question
You might need to use the sudo command, which is the *nix super user invocation. – martineau Oct 9 '12 at 7:15
up vote 2 down vote accepted

If you get an error that an object is in use, then ensure that you've stopped all services and closed all Cygwin programs. If you get a 'Permission Denied' error then you will need to modify the permissions and/or ownership of the files or folders that are causing the error. For example, sometimes files used by system services end up owned by the SYSTEM account and not writable by regular users.

The quickest way to delete the entire tree if you run into this problem is to change the ownership of all files and folders to your account. To do this in Windows Explorer, right click on the root Cygwin folder, choose Properties, then the Security tab. If you are using Windows XP Home or Simple File Sharing, you will need to boot into Safe Mode to access the Security tab. Select Advanced, then go to the Owner tab and make sure your account is listed as the owner. Select the 'Replace owner on subcontainers and objects' checkbox and press Ok. After Explorer applies the changes you should be able to delete the entire tree in one operation.

If you want to be thorough you can delete the registry tree Software\Cygwin under HKEY_LOCAL_MACHINE and/or HKEY_CURRENT_USER. However, if you followed the directions above you will have already removed everything important. Typically only the installation directory has been stored in the registry at all.

Here is the source Cygwin Link

share|improve this answer

Open an cmd.exe as administrator:

takeown /f "c:\cygwin" /r /d Y

The last parameter makes takeown assume yes to all questions and depends on locale. In my locale I had to answer "J" to make it work. YMMV.

icacls "c:\cygwin" /T /Q /C /reset

See and

Hope this works for you.

share|improve this answer
I had tried taking ownership, etc. and this is what finally worked for me! Thanks. – dub stylee Aug 12 '15 at 0:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .