Could not delete folder on Win7

时间:2024-01-02 14:38:04
I had the same problem on Win 7 and this worked for me in command prompt.
Solution 1:
RD/S pathname
example:
RD/s C:\Users\Username\Downloads\Music
 
this will delete all files and sub-folders in the folder, including the root folder itself.
Solution 2:

Run cmd, navigate to C:\ (or other disk, if you have installed it in different path).

step 1:

takeown /r /d y /f cygwin       //This command takes ownership recursive of the folder, without asking anything

step 2:

icacls cygwin /t /grant Everyone:F      //This command gives Full Access to Everyone recursively in the folder

step 3:

rmdir /s /q cygwin            //And finally, the command which deletes it all and removes Cygwin

reference:

http://problemsolv.in/2012/09/how-to-remove-cygwin-permission-denied-problem/