{"id":397,"date":"2012-07-18T13:17:47","date_gmt":"2012-07-18T10:17:47","guid":{"rendered":"http:\/\/fatihacar.com\/blog\/?p=397"},"modified":"2014-06-05T09:12:09","modified_gmt":"2014-06-05T06:12:09","slug":"delete-folders-and-files-older-than-specific-day-on-windows","status":"publish","type":"post","link":"https:\/\/www.fatihacar.com\/blog\/delete-folders-and-files-older-than-specific-day-on-windows\/","title":{"rendered":"Delete Folders And Files Older Than Specific Day on Windows"},"content":{"rendered":"<p>If you want to delete folder older than specific day, you can use below command. You can add to windows schedule job for schedule run.<\/p>\n<p><strong>Delete Command For Folders<\/strong><\/p>\n<blockquote><p>\nforfiles \/p C:\\temp\\  \/c &#8220;cmd \/c if @isdir==TRUE RMDIR \/S \/Q @path&#8221; \/d -30\n<\/p><\/blockquote>\n<p><strong>Delete Command For Files<\/strong><\/p>\n<blockquote><p>\nforfiles -p &#8220;C:\\temp&#8221; -s -m *.* \/D -30 \/C &#8220;cmd \/c del @path&#8221;\n<\/p><\/blockquote>\n<p>You can change this 30 parameter. This script will delete folder which is older 30 days from c:\\temp\\ folder. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want to delete folder older than specific day, you can use below command. You can add to windows schedule job for schedule run. Delete Command For Folders forfiles \/p C:\\temp\\ \/c &#8220;cmd \/c if @isdir==TRUE RMDIR \/S \/Q @path&#8221; \/d -30 Delete Command For Files forfiles -p &#8220;C:\\temp&#8221; -s -m *.* \/D -30&#8230;<\/p>\n","protected":false},"author":37,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[17],"tags":[22,94],"class_list":["post-397","post","type-post","status-publish","format-standard","hentry","category-windows","tag-system-administration","tag-windows"],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p39NFI-6p","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/users\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/comments?post=397"}],"version-history":[{"count":9,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/posts\/397\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/media?parent=397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/categories?post=397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fatihacar.com\/blog\/wp-json\/wp\/v2\/tags?post=397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}