{"id":1253,"date":"2014-02-13T10:50:31","date_gmt":"2014-02-13T08:50:31","guid":{"rendered":"http:\/\/hen.co.za\/blog\/?p=1253"},"modified":"2014-02-13T10:50:31","modified_gmt":"2014-02-13T08:50:31","slug":"deleting-a-folder-with-path-that-is-too-long","status":"publish","type":"post","link":"https:\/\/hen.co.za\/blog\/2014\/02\/deleting-a-folder-with-path-that-is-too-long\/","title":{"rendered":"Deleting a folder with path that is too long"},"content":{"rendered":"<p>Just a quick tip I came across today after having a problem where I found a directory where some tool went nuts and kept on creating subdirectories recursively. Trying to delete this directory will give you an error &#8211; something like &#8216;Path is too long&#8230;&#8217;<\/p>\n<p>Lets say the path is something like d:\\directory1\\directory1\\directory1\\directory1&#8230;..\\directory1<\/p>\n<p>Windows Explorer and even Command prompt won&#8217;t allow you to delete d:\\dir1 (No not even right-click delete will work).<\/p>\n<p>A simple solution is to recursively go and rename all the directories to something much shorter so the overall length is less that the maximum (260 characters).<\/p>\n<p>Like this: rename d:\\directory1 0\u00a0 , rename d:\\0\\directory1 0 etc.<\/p>\n<p>The end result should be like this: d:\\0\\0\\0\\0&#8230; \\0<\/p>\n<p>Now you can simply delete it in Windows Explorer without any &#8216;Path Too long&#8217; errors.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a quick tip I came across today after having a problem where I found a directory where some tool went nuts and kept on creating subdirectories recursively. Trying to delete this directory will give you an error &#8211; something &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/hen.co.za\/blog\/2014\/02\/deleting-a-folder-with-path-that-is-too-long\/\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[24,82],"class_list":["post-1253","post","type-post","status-publish","format-standard","hentry","category-reference","tag-tip","tag-windows"],"_links":{"self":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/1253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/comments?post=1253"}],"version-history":[{"count":1,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/1253\/revisions"}],"predecessor-version":[{"id":1254,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/posts\/1253\/revisions\/1254"}],"wp:attachment":[{"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/media?parent=1253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/categories?post=1253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hen.co.za\/blog\/wp-json\/wp\/v2\/tags?post=1253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}