Showing posts with label folder Access denied error. Show all posts
Showing posts with label folder Access denied error. Show all posts

Wednesday, November 5, 2008

How to delete cygwin folder

The other day I spent sold 2 hours trying to delete the annoying cygwin folder for installing a cleaner version. :p

every time I deleted it gave me access denied error until I used calcs in command prompt to reset the permissions. (Equivalent to chmod *.* 777)

CACLS c:\cygwin /E /T /C /G "wahmed":F

where wahmed is my user account in windows. After that just right clicked the folder and poof, deleted. Phew!

------------------------------------------
I suppose before you get to the above point, you already have done this small bit

Complete Method
First kill the cygwin services, by either going to Start>RUN>services.msc or type these lines in cmd prompt/Run
1 - cygrunsrv -E sshd
2 - cygrunsrv -R sshd

3 - Delete the folder c:\cygwin and all its sub-folders (if it doesn’t get deleted follow the above guide)

4 - Remove the Environment Variable CYGWIN (by right clicking My Computer->Properties->Advance-Environmental Variables) edit the Environment path accordingly

5 - Start>Run>regedit and delete these two registry trees
"HKEY_CURRENT_USER_Software_Cygnus Solutions"
"HKEY_LOCAL_MACHINE_Software_Cygnus Solutions"

6 - Go to Control Panel>Category View>Performance and Maintenance>Administrative Tools, Computer Management.
or click Start>Run>compmgmt.msc
delete the sshd user if it exists in the "System Tools" - "Local Users and Groups" - "Users" section.
-----------------------------------