{"id":76147,"date":"2024-07-29T13:43:33","date_gmt":"2024-07-29T08:13:33","guid":{"rendered":"http:\/\/198.58.113.91\/blog\/?p=76147"},"modified":"2026-03-09T12:16:38","modified_gmt":"2026-03-09T06:46:38","slug":"delete-cygwin64-folder","status":"publish","type":"post","link":"https:\/\/www.winhelponline.com\/blog\/delete-cygwin64-folder\/","title":{"rendered":"Fix: Cannot Delete the Cygwin64 folder"},"content":{"rendered":"<p>If you installed &#8220;cygwin64&#8221; earlier and want to delete the folder after uninstalling the tool, you may be unable to do so.<\/p>\n<p>It may say, &#8220;Folder Access Denied.&#8221; This can happen if the NTFS permissions for the folder are tight or the profile that owned the folder no longer exists on the computer.<!--more--><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76148\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/cygwin-cant-delete.png\" alt=\"cygwin cannot delete folder\" width=\"562\" height=\"321\" \/><\/p>\n<div class=\"rp\"><strong>RELATED:<\/strong> <a href=\"https:\/\/www.winhelponline.com\/blog\/delete-a-stubborn-file-folder-in-windows\/\">How to Delete a Stubborn Undeletable File or Folder in Windows<\/a><\/div>\n<h2>Resolution<\/h2>\n<h3>Boot into Safe mode<\/h3>\n<p>Please try deleting the folder in Safe mode to rule out the &#8220;file-in-use&#8221; scenario. See <a href=\"https:\/\/www.winhelponline.com\/blog\/start-windows-11-or-10-safe-mode\/\">How to Start Windows 10 or 11 in Safe Mode<\/a>.<\/p>\n<p>If the same error occurs in Safe mode, take ownership of the folder and delete it.<\/p>\n<p>Use one of the methods below if Safe mode doesn&#8217;t help.<\/p>\n<hr>\n<h3>Take ownership and delete the folder<\/h3>\n<p>From an <a href=\"https:\/\/www.winhelponline.com\/blog\/open-elevated-command-prompt-windows\/\">admin Command Prompt<\/a>, run these commands to take ownership and delete the folder.<\/p>\n<pre class=\"cmd\">takeown \/f \"C:\\cygwin64\" \/r \/d y\n\nicacls \"c:\\cygwin64\" \/T \/Q \/C \/reset\n\nicacls \"C:\\cygwin64\" \/grant *S-1-5-32-544:F \/t \/c\n\nrd \"C:\\cygwin64\" \/s \/q<\/pre>\n<p>Sometimes, you may get the error &#8220;Access is denied&#8221; when assigning permissions using Icacls.exe.<\/p>\n<p>In that case, use the Trusted Installer Command Prompt.<\/p>\n<hr \/>\n<h3>Use Trusted Installer Command Prompt<\/h3>\n<p>Download <a href=\"https:\/\/www.nirsoft.net\/utils\/advanced_run.html\">AdvancedRun<\/a> from Nirsoft.net and run it.<\/p>\n<p>Using AdvancedRun, launch <strong>cmd.exe<\/strong> as &#8220;TrustedInstaller.&#8221;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-31199\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2016\/08\/advancedrun-screen.png\" alt=\"advancedrun - trustedinstaller\" width=\"760\" height=\"585\" \/><\/p>\n<p>In the <strong>TrustedInstaller<\/strong> Command Prompt, run:<\/p>\n<pre class=\"cmd\">rd \/s \/q \"\\\\?\\c:\\cygwin64\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76152\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/cygwin-remove-internal-syntax.png\" alt=\"cygwin folder cannot delete - use WinRE\" width=\"284\" height=\"135\" \/><\/p>\n<p>If that doesn&#8217;t help, try the WinRE method below.<\/p>\n<hr \/>\n<h3>Boot into WinRE<\/h3>\n<p>Boot into Windows RE using one of the methods in the article <a href=\"https:\/\/www.winhelponline.com\/blog\/access-windows-recovery-environment\/\">How to access Windows Recovery Environment<\/a>.<\/p>\n<p>From the login screen, click Shutdown, then hold down the Shift key while selecting Restart.<\/p>\n<p>In WinRE, click Troubleshoot, Advanced Options, and <strong>Command Prompt<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-27830\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2022\/08\/winre-screen-system-image-recovery.png\" alt=\"win re system image backup recovery\" width=\"670\" height=\"397\" \/><\/p>\n<p>Run:<\/p>\n<pre class=\"cmd\">bcdedit | find \"osdevice\"<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76153\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/winre-bcdedit-find-osdevice.jpg\" alt=\"find osdevice in winre by running bcdedit\" width=\"750\" height=\"231\" \/><\/p>\n<p>Note the OS drive letter in the output. Assuming it&#8217;s <strong>C:\\<\/strong>, run:<\/p>\n<pre class=\"cmd\">rd \"C:\\cygwin64\" \/s \/q<\/pre>\n<p>If it&#8217;s <strong>D:\\<\/strong>, run:<\/p>\n<pre class=\"cmd\">rd \"D:\\cygwin64\" \/s \/q<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-76150\" src=\"https:\/\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/07\/cygwin-cant-delete-winre.jpg\" alt=\"cygwin folder cannot delete - use WinRE\" width=\"750\" height=\"473\" \/><\/p>\n<p>If it says, &#8220;The device is not ready&#8221;, try the Windows internal syntax below:<\/p>\n<pre class=\"cmd\">rd \"\\\\?\\C:\\cygwin64\" \/s \/q<\/pre>\n<p>(or)<\/p>\n<pre class=\"cmd\">rd \"\\\\?\\D:\\cygwin64\" \/s \/q<\/pre>\n<p>If not, try the WinRAR method below to delete or rename the folder.<\/p>\n<hr \/>\n<h3>Install WinRAR<\/h3>\n<p>Please install WinRAR and run its executable as <strong>TrustedInstaller<\/strong> using AdvancedRun.<\/p>\n<p>Using WinRAR&#8217;s file manager interface, please see if you can browse the contents of the Cygwin64 directory and its subfolders. Also, try renaming the &#8220;<strong>Cygwin64<\/strong>&#8221; directory to &#8220;<strong>demo<\/strong>&#8221; or something else. Browse the contents of the folder, or press <strong>Shift<\/strong> + <strong>Del<\/strong> to delete the folder permanently.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you installed &#8220;cygwin64&#8221; earlier and want to delete the folder after uninstalling the tool, you may be unable to do so. It may say, &#8220;Folder Access Denied.&#8221; This can happen if the NTFS permissions for the folder are tight or the profile that owned the folder no longer exists on the computer.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,8,869],"tags":[106,680],"class_list":["post-76147","post","type-post","status-publish","format-standard","hentry","category-utilities","category-windows-10","category-windows-11","tag-command-prompt","tag-windows-recovery-environment"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":6319,"url":"https:\/\/www.winhelponline.com\/blog\/delete-a-stubborn-file-folder-in-windows\/","url_meta":{"origin":76147,"position":0},"title":"How to Delete a Stubborn Undeletable File or Folder in Windows","author":"Ramesh","date":"July 21, 2018","format":false,"excerpt":"Many of you would have come across situations where you can't delete a file or folder no matter how you try. This article discusses the ways to delete files or folders that are stubborn or undeletable using normal methods. There could be at least 4 reasons you cannot remove those\u2026","rel":"","context":"In &quot;Utilities&quot;","block_context":{"text":"Utilities","link":"https:\/\/www.winhelponline.com\/blog\/category\/utilities\/"},"img":{"alt_text":"duplicate windows directory - inaccessible","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/07\/duplicate-windows-dir-2.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/07\/duplicate-windows-dir-2.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2018\/07\/duplicate-windows-dir-2.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":17887,"url":"https:\/\/www.winhelponline.com\/blog\/windows-defender-identifies-same-threat-repeatedly\/","url_meta":{"origin":76147,"position":1},"title":"Windows Defender Shows the Same Threat Repeatedly. How to Clear the Protection History","author":"Ramesh","date":"August 14, 2020","format":false,"excerpt":"On some Windows 10 and 11 computers, Microsoft Defender Antivirus may repeatedly warn about the same threat, although you've taken the necessary action (remediated) on that threat. When you click \"Start actions\" after choosing \"Remove\", nothing happens. Windows Defender would keep showing that non-existent threat. Cause This is caused by\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"detectionhistory folder contents","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/defender-detection-history-delete.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/defender-detection-history-delete.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/defender-detection-history-delete.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2020\/08\/defender-detection-history-delete.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":80351,"url":"https:\/\/www.winhelponline.com\/blog\/unable-to-hide-programdata\/","url_meta":{"origin":76147,"position":2},"title":"[Fix] Unable to Hide the ProgramData folder","author":"Ramesh","date":"February 27, 2026","format":false,"excerpt":"The ProgramData folder is hidden by default. Some users may inadvertently unhide the folder using Explorer, but are unable to hide it again. Reenabling the Hidden checkbox in the folder's properties, selecting \"Apply changes to this folder only\" in the \"Confirm Attribute Changes\" dialog, and clicking OK may not work.\u2026","rel":"","context":"In &quot;Windows 10&quot;","block_context":{"text":"Windows 10","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/windows-10\/"},"img":{"alt_text":"hide programdata folder","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2026\/02\/hide-programdata-folder-1.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":5521,"url":"https:\/\/www.winhelponline.com\/blog\/error-0x80070091-directory-not-empty-deleting-folder-copying-chkdsk\/","url_meta":{"origin":76147,"position":3},"title":"Error 0x80070091 &#8220;The directory is not empty&#8221; When Deleting or Copying a Folder","author":"Ramesh","date":"October 15, 2017","format":false,"excerpt":"When you attempt to delete a folder or copy it to another location or drive, the following error may pop up: Interrupted Action. An unexpected error is keeping you from deleting the folder. If you continue to receive this error, you can use the error code to search for help\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"0x80070091 directory not empty","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2017\/10\/0x80070091_dir_not_empty.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":76797,"url":"https:\/\/www.winhelponline.com\/blog\/cant-delete-nltmpmnt-temp-folder\/","url_meta":{"origin":76147,"position":4},"title":"[Fix] Can&#8217;t delete NLTmpMnt from the Temp folder","author":"Ramesh","date":"October 17, 2024","format":false,"excerpt":"When you use Disk Cleanup or manually attempt to clear the %temp% folder of your user profile, the \"NLTmpMnt\" subfolder in your Temp folder can't be deleted. You get the following error when deleting the folder: Folder Access Denied You need permission to perform this action. You require permission from\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"nltmpmnt folder cannot delete - unload using NTLite","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/10\/nltmpmnt-ntlite-unload.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/10\/nltmpmnt-ntlite-unload.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/10\/nltmpmnt-ntlite-unload.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2024\/10\/nltmpmnt-ntlite-unload.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":9058,"url":"https:\/\/www.winhelponline.com\/blog\/failed-to-enumerate-objects-in-the-container-ownership\/","url_meta":{"origin":76147,"position":5},"title":"Fix: &#8220;Failed to Enumerate Objects in the Container&#8221; Error","author":"Ramesh","date":"May 6, 2019","format":false,"excerpt":"When you try to open a folder, you may see the message \"You don't currently have permission to access this folder.\u00a0Click Continue to permanently get access to this folder.\" Clicking on the Continue shows the message \"You have been denied permission to access this folder.\u00a0To gain access to this folder\u2026","rel":"","context":"In &quot;Windows&quot;","block_context":{"text":"Windows","link":"https:\/\/www.winhelponline.com\/blog\/category\/microsoft\/windows\/"},"img":{"alt_text":"failed to enumerate objects in the container - change ownership recursively sub-folders","src":"https:\/\/i0.wp.com\/www.winhelponline.com\/blog\/wp-content\/uploads\/2019\/05\/w10-safe-mode-win-re.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/76147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/comments?post=76147"}],"version-history":[{"count":0,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/posts\/76147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/media?parent=76147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/categories?post=76147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.winhelponline.com\/blog\/wp-json\/wp\/v2\/tags?post=76147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}