{"id":93432,"date":"2023-05-08T06:00:32","date_gmt":"2023-05-08T10:00:32","guid":{"rendered":"https:\/\/pureinfotech.com\/?p=93432"},"modified":"2023-05-08T08:45:58","modified_gmt":"2023-05-08T12:45:58","slug":"delete-files-older-than-days-windows-10","status":"publish","type":"post","link":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/","title":{"rendered":"How to delete files older than X days automatically on Windows 10"},"content":{"rendered":"<ul class=\"sum\">\n<li>To delete files older than 30 days on Windows 10, use the <strong>&#8220;ForFiles&#8221;<\/strong> command.<\/li>\n<li>The command is: <strong>ForFiles \/p &#8220;C:\\path\\to\\folder&#8221; \/s \/d -30 \/c &#8220;cmd \/c del \/q @file&#8221;<\/strong>.<\/li>\n<li>Change <strong>&#8220;30&#8221;<\/strong> to the number of days you want and the folder path.<\/li>\n<\/ul>\n<p>On Windows 10, you can use Command Prompt and Task Scheduler to automatically delete files older than a certain number of days to free up space and keep your files organized.<\/p>\n<p>The Settings app includes <a href=\"https:\/\/pureinfotech.com\/free-up-space-windows-10-after-update\/\">Storage Sense<\/a>, a feature that automatically runs when the storage is low in space. Alongside the ability to delete temporary files, you can also enable the feature to delete files in the recycle bin or Downloads folder that haven&#8217;t changed in the last 30 days. However, it is limited and doesn&#8217;t offer an option to monitor additional folders to delete files that haven&#8217;t changed in the previous 60 days.<\/p>\n<p>When you store temporary files from the internet or projects in different folders, it&#8217;s possible to use the <strong>ForFiles<\/strong> command in Command Prompt and Task Scheduler to delete files from any folder older than a specific number of days.<\/p>\n<p>In this <a href=\"https:\/\/pureinfotech.com\/tag\/how-to\/\">guide<\/a>, you will learn the steps to manually delete files that haven&#8217;t been modified in a specific number of days and the instructions to create an automated task that will delete files older than a certain number of days inside any folder on <a href=\"https:\/\/pureinfotech.com\/tag\/windows-10\/\">Windows 10<\/a>.<\/p>\n<div id=\"tip-box-red\" ><span><strong>Important:<\/strong> Before using the command on the folder you want to organize, it is recommended to test these steps using a test folder, as using the incorrect parameters and other mistakes can cause the deletion of the wrong files.<\/span><\/div>\n<ul class=\"toc\">\n<li><a href=\"#forfiles_delete_command\">Delete files older than X days using ForFiles on Windows 10<\/a><\/li>\n<li><a href=\"#forfiles_delete_command_taskscheduler\">Delete files older than X days automatically using Task Scheduler on Windows 10<\/a><\/li>\n<li><a href=\"https:\/\/pureinfotech.com\/delete-files-older-than-days-powershell\/\"><strong>Delete files older than X days automatically using PowerShell<\/strong><\/a><\/li>\n<\/ul>\n<h2 id=\"forfiles_delete_command\">Delete files older than X days using ForFiles on Windows 10<\/h2>\n<p>If you have different folders with many files and would like to clean up by deleting those older than a certain number of days, you can use the ForFiles command.<\/p>\n<p>To use the ForFiles command to delete files older than a certain number of days on Windows 10, use these steps:<\/p>\n<ol>\n<li>\n<p>Open <strong>Start <\/strong>on Windows 10.<\/p>\n<\/li>\n<li>\n<p>Search for <strong>Command Prompt<\/strong>, right-click the result, and select the <strong>Run as administrator<\/strong> option.<\/p>\n<\/li>\n<li>\n<p>Type the following command to delete files on Windows 10 that haven&#8217;t been modified in the last 30 days and press <strong>Enter<\/strong>:<\/p>\n<pre>ForFiles \/p \"C:\\path\\to\\folder\" \/s \/d -30 \/c \"cmd \/c del \/q @file\"<\/pre>\n<p>In the command, change <code>\"C:\\path\\to\\folder\"<\/code> specifying the path to the folder you want to delete files and change <code>\/d -30<\/code> to select files with a last modified date.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-144636\" src=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/forfiles-windows-10-delete-files-older-than-2022.webp?resize=827%2C251&#038;quality=78&#038;strip=all&#038;ssl=1\" alt=\"Command Prompt ForFiles \" width=\"827\" height=\"251\" srcset=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/forfiles-windows-10-delete-files-older-than-2022.webp?w=930&amp;quality=78&amp;strip=all&amp;ssl=1 930w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/forfiles-windows-10-delete-files-older-than-2022.webp?resize=300%2C91&amp;quality=78&amp;strip=all&amp;ssl=1 300w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/forfiles-windows-10-delete-files-older-than-2022.webp?resize=150%2C45&amp;quality=78&amp;strip=all&amp;ssl=1 150w\" sizes=\"auto, (max-width: 827px) 100vw, 827px\" \/><\/li>\n<\/ol>\n<h3>ForFiles command breakdown<\/h3>\n<ul>\n<li><strong>\/p &#8212;<\/strong> indicates the pathname to start searching.<\/li>\n<li><strong>\/s &#8212;<\/strong> instructs ForFiles to search inside subdirectories.<\/li>\n<li><strong>\/d &#8212;<\/strong> specifies the last modified date for a file.<\/li>\n<li><strong>\/c &#8212;<\/strong> instructs the ForFiles tool to execute the command (must be wrapped in double quotes). The default is <strong>&#8220;cmd \/c del @file.&#8221;<\/strong><\/li>\n<li><strong>\/q<\/strong> &#8212; allows deleting folders without requiring confirmation.\u00a0<\/li>\n<\/ul>\n<p>If you want to learn more about these switches, use the <code>ForFiles \/?<\/code> Command.<\/p>\n<h2 id=\"forfiles_delete_command_taskscheduler\">Delete files older than X days automatically using Task Scheduler on Windows 10<\/h2>\n<p>The command in the previous instructions allows you to delete files in a folder older than 30 days, but you need to open Command Prompt and execute the command manually whenever you want to free up space.<\/p>\n<p>To automate the process, you must use the Task Scheduler on Windows 10 to create a task executing the command at specified intervals.<\/p>\n<p>To create a scheduled task with the ForFiles commands to delete files that haven&#8217;t changed in some time, use these steps:<\/p>\n<ol>\n<li>\n<p>Open <strong>Start<\/strong>.<\/p>\n<\/li>\n<li>\n<p>Search for\u00a0<strong>Task Scheduler<\/strong> and click the top result to open the experience.<\/p>\n<\/li>\n<li>\n<p>Right-click the <strong>&#8220;Task Scheduler Library&#8221;<\/strong> folder.<\/p>\n<\/li>\n<li>\n<p>Click the\u00a0<strong>New Folder<\/strong> option.<\/p>\n<\/li>\n<li>\n<p>Type any name for the folder and click the <strong>OK <\/strong>button. (We&#8217;re creating a new folder to keep tasks organized and separated from the system tasks.)<\/p>\n<\/li>\n<li>\n<p>Right-click the recently created folder and select the <strong>Create Task <\/strong>option.<\/p>\n<\/li>\n<li>\n<p>In the &#8220;Name&#8221; box, enter a name for the task.<\/p>\n<\/li>\n<li>\n<p>In the &#8220;General&#8221; tab, under the &#8220;Security options&#8221; section, select the &#8220;<strong>Run whether user is logged on or not&#8221;<\/strong> option. (This option will make the command window not appear when the task runs automatically.)<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-93448\" src=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/create-task-general.jpg?resize=632%2C480&#038;quality=78&#038;strip=all&#038;ssl=1\" alt=\"Task Scheduler General tab\" width=\"632\" height=\"480\" srcset=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/create-task-general.jpg?w=632&amp;quality=78&amp;strip=all&amp;ssl=1 632w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/create-task-general.jpg?resize=300%2C228&amp;quality=78&amp;strip=all&amp;ssl=1 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/p>\n<\/li>\n<li>\n<p>Clear the <strong>&#8220;Do not store password&#8221;<\/strong> option.<\/p>\n<\/li>\n<li>\n<p>Click the &#8220;Triggers&#8221; tab, and click the <strong>New<\/strong> button.<\/p>\n<\/li>\n<li>\n<p>Select the <strong>&#8220;On a schedule&#8221;<\/strong> option using the &#8220;Begin the task&#8221; setting.<\/p>\n<\/li>\n<li>\n<p>Under &#8220;Settings,&#8221; specify when you want the task to run (for example, On time, Daily, Weekly, or Monthly). Whatever option you select, set the <strong>Start<\/strong> settings on the right side.<\/p>\n<\/li>\n<li>\n<p>Click the\u00a0<strong>OK <\/strong>button.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-93449\" src=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/trigger-schedule-task.jpg?resize=591%2C516&#038;quality=78&#038;strip=all&#038;ssl=1\" alt=\"Task Scheduler Trigger settings\" width=\"591\" height=\"516\" srcset=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/trigger-schedule-task.jpg?w=591&amp;quality=78&amp;strip=all&amp;ssl=1 591w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/trigger-schedule-task.jpg?resize=300%2C262&amp;quality=78&amp;strip=all&amp;ssl=1 300w\" sizes=\"auto, (max-width: 591px) 100vw, 591px\" \/><\/p>\n<\/li>\n<li>\n<p>Click the &#8220;Actions&#8221; tab, and click the <strong>New<\/strong> Button.<\/p>\n<\/li>\n<li>\n<p>Use the &#8220;Actions&#8221; drop-down menu and select the <strong>&#8220;Start a program&#8221; <\/strong>option.<\/p>\n<\/li>\n<li>\n<p>In the &#8220;Program\/script&#8221; box, type the following command:<\/p>\n<pre>ForFiles<\/pre>\n<\/li>\n<li>\n<p>Type the following command in the &#8220;Add arguments&#8221; box and click the <strong>OK <\/strong>button.<\/p>\n<pre>\/p \"C:\\path\\to\\folder\" \/s \/d -30 \/c \"cmd \/c del \/q @file\"<\/pre>\n<p>In the command, change <code>\"C:\\path\\to\\folder\"<\/code> specifying the path to the folder that you want to delete files and change <code>\/d -30<\/code> to select files with the last modified date.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-93450\" src=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/forfiles-action-task-scheduler.jpg?resize=454%2C500&#038;quality=78&#038;strip=all&#038;ssl=1\" alt=\"Task Scheduler Action settings\" width=\"454\" height=\"500\" srcset=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/forfiles-action-task-scheduler.jpg?w=454&amp;quality=78&amp;strip=all&amp;ssl=1 454w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/forfiles-action-task-scheduler.jpg?resize=272%2C300&amp;quality=78&amp;strip=all&amp;ssl=1 272w\" sizes=\"auto, (max-width: 454px) 100vw, 454px\" \/><\/p>\n<\/li>\n<li>\n<p>Click the <strong>OK<\/strong> button.<\/p>\n<\/li>\n<li>\n<p>Click the &#8220;Settings&#8221; tab, and make sure to check the following options:<\/p>\n<ul>\n<li>Allow task to be run on demand.<\/li>\n<li>Run task as soon as possible after a scheduled start is missed.<\/li>\n<li>If the task fails, restart every.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Click the\u00a0<strong>OK <\/strong>button.<\/p>\n<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-93451\" src=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/task-settings-options-windows10.jpg?resize=632%2C480&#038;quality=78&#038;strip=all&#038;ssl=1\" alt=\"Task Scheduler additional settings\" width=\"632\" height=\"480\" srcset=\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/task-settings-options-windows10.jpg?w=632&amp;quality=78&amp;strip=all&amp;ssl=1 632w, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/10\/task-settings-options-windows10.jpg?resize=300%2C228&amp;quality=78&amp;strip=all&amp;ssl=1 300w\" sizes=\"auto, (max-width: 632px) 100vw, 632px\" \/><\/p>\n<\/li>\n<li>\n<p>If prompted, enter your administrative username and password.<\/p>\n<\/li>\n<li>\n<p>Click the\u00a0<strong>OK <\/strong>button.<\/p>\n<\/li>\n<\/ol>\n<p>Once you complete the steps, the command will run on the schedule deleting the files older than the number of days you specified. Remember not to change the name or move the folder to another location. Otherwise, the task will fail.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can free up space and keep things organized by only deleting files that are older than a certain number of days in any folder \u2014 here&#8217;s how to do it.<\/p>\n","protected":false},"author":2,"featured_media":155413,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"jetpack_post_was_ever_published":false,"footnotes":""},"categories":[2426,23],"tags":[97,19,2540,2576],"class_list":["post-93432","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-features","category-windows","tag-difficulty-level-advanced","tag-how-to","tag-windows-10","tag-windows-help"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to delete files older than X days automatically on Windows 10 - Pureinfotech<\/title>\n<meta name=\"description\" content=\"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here&#039;s how to do it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to delete files older than X days automatically on Windows 10 - Pureinfotech\" \/>\n<meta property=\"og:description\" content=\"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here&#039;s how to do it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\" \/>\n<meta property=\"og:site_name\" content=\"Pureinfotech \u2022 Windows 10 &amp; Windows 11 help for humans\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pureinfotech\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-08T10:00:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-08T12:45:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1681\" \/>\n\t<meta property=\"og:image:height\" content=\"1041\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Mauro Huculak\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Pureinfotech\" \/>\n<meta name=\"twitter:site\" content=\"@Pureinfotech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mauro Huculak\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\"},\"author\":{\"name\":\"Mauro Huculak\",\"@id\":\"https:\/\/pureinfotech.com\/#\/schema\/person\/bf4921a81eb4380865af70691a93af43\"},\"headline\":\"How to delete files older than X days automatically on Windows 10\",\"datePublished\":\"2023-05-08T10:00:32+00:00\",\"dateModified\":\"2023-05-08T12:45:58+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\"},\"wordCount\":942,\"publisher\":{\"@id\":\"https:\/\/pureinfotech.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1\",\"keywords\":[\"Difficulty level: Advanced\",\"How-To\",\"Windows 10\",\"Windows Help\"],\"articleSection\":[\"Features\",\"Windows\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\",\"url\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\",\"name\":\"How to delete files older than X days automatically on Windows 10 - Pureinfotech\",\"isPartOf\":{\"@id\":\"https:\/\/pureinfotech.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1\",\"datePublished\":\"2023-05-08T10:00:32+00:00\",\"dateModified\":\"2023-05-08T12:45:58+00:00\",\"description\":\"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here's how to do it.\",\"breadcrumb\":{\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1\",\"width\":1681,\"height\":1041,\"caption\":\"Delete older than files on Windows 10\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pureinfotech.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to delete files older than X days automatically on Windows 10\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/pureinfotech.com\/#website\",\"url\":\"https:\/\/pureinfotech.com\/\",\"name\":\"Pureinfotech \u2022 Windows 10 &amp; Windows 11 help for humans\",\"description\":\"Pureinfotech is the best site to get Windows help \u2013 featuring friendly how-to guides on Windows 10, Windows 11, Xbox, and other things tech, news, deals, reviews, and more.\",\"publisher\":{\"@id\":\"https:\/\/pureinfotech.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/pureinfotech.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/pureinfotech.com\/#organization\",\"name\":\"Pureinfotech\",\"url\":\"https:\/\/pureinfotech.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pureinfotech.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2019\/05\/pure-logo-v45.png?fit=192%2C192&quality=78&strip=all&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2019\/05\/pure-logo-v45.png?fit=192%2C192&quality=78&strip=all&ssl=1\",\"width\":192,\"height\":192,\"caption\":\"Pureinfotech\"},\"image\":{\"@id\":\"https:\/\/pureinfotech.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pureinfotech\",\"https:\/\/x.com\/Pureinfotech\",\"https:\/\/www.youtube.com\/user\/Pureinfotech\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/pureinfotech.com\/#\/schema\/person\/bf4921a81eb4380865af70691a93af43\",\"name\":\"Mauro Huculak\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g\",\"caption\":\"Mauro Huculak\"},\"description\":\"Mauro Huculak is a Windows How-To Expert and founder of Pureinfotech (est. 2010). With over 21 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS. Certifications he holds include Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+. Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central. You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at Contact@Pureinfotech.com.\",\"sameAs\":[\"https:\/\/pureinfotech.com\",\"https:\/\/x.com\/@Pureinfotech\"],\"url\":\"https:\/\/pureinfotech.com\/mauro-huculak\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to delete files older than X days automatically on Windows 10 - Pureinfotech","description":"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here's how to do it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/","og_locale":"en_US","og_type":"article","og_title":"How to delete files older than X days automatically on Windows 10 - Pureinfotech","og_description":"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here's how to do it.","og_url":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/","og_site_name":"Pureinfotech \u2022 Windows 10 &amp; Windows 11 help for humans","article_publisher":"https:\/\/facebook.com\/pureinfotech","article_published_time":"2023-05-08T10:00:32+00:00","article_modified_time":"2023-05-08T12:45:58+00:00","og_image":[{"width":1681,"height":1041,"url":"https:\/\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp","type":"image\/webp"}],"author":"Mauro Huculak","twitter_card":"summary_large_image","twitter_creator":"@Pureinfotech","twitter_site":"@Pureinfotech","twitter_misc":{"Written by":"Mauro Huculak","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#article","isPartOf":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/"},"author":{"name":"Mauro Huculak","@id":"https:\/\/pureinfotech.com\/#\/schema\/person\/bf4921a81eb4380865af70691a93af43"},"headline":"How to delete files older than X days automatically on Windows 10","datePublished":"2023-05-08T10:00:32+00:00","dateModified":"2023-05-08T12:45:58+00:00","mainEntityOfPage":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/"},"wordCount":942,"publisher":{"@id":"https:\/\/pureinfotech.com\/#organization"},"image":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1","keywords":["Difficulty level: Advanced","How-To","Windows 10","Windows Help"],"articleSection":["Features","Windows"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/","url":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/","name":"How to delete files older than X days automatically on Windows 10 - Pureinfotech","isPartOf":{"@id":"https:\/\/pureinfotech.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage"},"image":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1","datePublished":"2023-05-08T10:00:32+00:00","dateModified":"2023-05-08T12:45:58+00:00","description":"You can free up space by deleting files that are older than a certain number of days in any folder \u2014 here's how to do it.","breadcrumb":{"@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#primaryimage","url":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1","contentUrl":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1","width":1681,"height":1041,"caption":"Delete older than files on Windows 10"},{"@type":"BreadcrumbList","@id":"https:\/\/pureinfotech.com\/delete-files-older-than-days-windows-10\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pureinfotech.com\/"},{"@type":"ListItem","position":2,"name":"How to delete files older than X days automatically on Windows 10"}]},{"@type":"WebSite","@id":"https:\/\/pureinfotech.com\/#website","url":"https:\/\/pureinfotech.com\/","name":"Pureinfotech \u2022 Windows 10 &amp; Windows 11 help for humans","description":"Pureinfotech is the best site to get Windows help \u2013 featuring friendly how-to guides on Windows 10, Windows 11, Xbox, and other things tech, news, deals, reviews, and more.","publisher":{"@id":"https:\/\/pureinfotech.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pureinfotech.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pureinfotech.com\/#organization","name":"Pureinfotech","url":"https:\/\/pureinfotech.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pureinfotech.com\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2019\/05\/pure-logo-v45.png?fit=192%2C192&quality=78&strip=all&ssl=1","contentUrl":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2019\/05\/pure-logo-v45.png?fit=192%2C192&quality=78&strip=all&ssl=1","width":192,"height":192,"caption":"Pureinfotech"},"image":{"@id":"https:\/\/pureinfotech.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pureinfotech","https:\/\/x.com\/Pureinfotech","https:\/\/www.youtube.com\/user\/Pureinfotech"]},{"@type":"Person","@id":"https:\/\/pureinfotech.com\/#\/schema\/person\/bf4921a81eb4380865af70691a93af43","name":"Mauro Huculak","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1cbac450402490f703560c52c3114f3e5ab02a741684eb73917885ae4a117a16?s=96&d=mm&r=g","caption":"Mauro Huculak"},"description":"Mauro Huculak is a Windows How-To Expert and founder of Pureinfotech (est. 2010). With over 21 years as a technology writer and IT Specialist, Mauro specializes in Windows, software, and cross-platform systems such as Linux, Android, and macOS. Certifications he holds include Microsoft Certified Solutions Associate (MCSA), Cisco Certified Network Professional (CCNP), VMware Certified Professional (VCP), and CompTIA A+ and Network+. Mauro is a recognized Microsoft MVP and has also been a long-time contributor to Windows Central. You can follow him on YouTube, Threads, BlueSky, X (Twitter), LinkedIn and About.me. Email him at Contact@Pureinfotech.com.","sameAs":["https:\/\/pureinfotech.com","https:\/\/x.com\/@Pureinfotech"],"url":"https:\/\/pureinfotech.com\/mauro-huculak"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/12\/windows-10-delete-older-than-files-hero.webp?fit=1681%2C1041&quality=78&strip=all&ssl=1","jetpack-related-posts":[{"id":144478,"url":"https:\/\/pureinfotech.com\/delete-older-files-by-date-windows-11\/","url_meta":{"origin":93432,"position":0},"title":"How to delete older files by date on Windows 11","author":"Mauro Huculak","date":"June 17, 2022","format":false,"excerpt":"You can quickly delete files older than 7, 30, 45, 60 days, etc., using Command Prompt and PowerShell, and here's how on Windows 11.","rel":"","context":"","block_context":{"text":"Features","link":"https:\/\/pureinfotech.com\/category\/features\/"},"img":{"alt_text":"Windows 11 delete older files X days","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/06\/windows-11-delete-older-file-x-days.webp?fit=1200%2C723&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/06\/windows-11-delete-older-file-x-days.webp?fit=1200%2C723&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/06\/windows-11-delete-older-file-x-days.webp?fit=1200%2C723&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/06\/windows-11-delete-older-file-x-days.webp?fit=1200%2C723&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/06\/windows-11-delete-older-file-x-days.webp?fit=1200%2C723&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":128834,"url":"https:\/\/pureinfotech.com\/use-forfiles-shared-network-folder-windows-10\/","url_meta":{"origin":93432,"position":1},"title":"How to use ForFiles command on shared network folder on Windows 10","author":"Mauro Huculak","date":"January 6, 2021","format":false,"excerpt":"You can use the ForFiles command against a network folder, but you need to use a workaround \u2013 here's how.","rel":"","context":"","block_context":{"text":"Features","link":"https:\/\/pureinfotech.com\/category\/features\/"},"img":{"alt_text":"ForFiles in network folder","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2021\/01\/forfiles-network-folder-windows-10_hero.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2021\/01\/forfiles-network-folder-windows-10_hero.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2021\/01\/forfiles-network-folder-windows-10_hero.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2021\/01\/forfiles-network-folder-windows-10_hero.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2021\/01\/forfiles-network-folder-windows-10_hero.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":94617,"url":"https:\/\/pureinfotech.com\/delete-files-older-than-days-powershell\/","url_meta":{"origin":93432,"position":2},"title":"How to delete files older than X days automatically using PowerShell","author":"Mauro Huculak","date":"February 6, 2023","format":false,"excerpt":"You can use PowerShell to free up space and keep things organized by only deleting files older than a certain number of days in any folder \u2014 here's how to do it on Windows 10.","rel":"","context":"","block_context":{"text":"Features","link":"https:\/\/pureinfotech.com\/category\/features\/"},"img":{"alt_text":"PowerShell delete older files","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/03\/windows-10-powershell-delete-older-files-hero.webp?fit=1200%2C746&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/03\/windows-10-powershell-delete-older-files-hero.webp?fit=1200%2C746&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/03\/windows-10-powershell-delete-older-files-hero.webp?fit=1200%2C746&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/03\/windows-10-powershell-delete-older-files-hero.webp?fit=1200%2C746&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/03\/windows-10-powershell-delete-older-files-hero.webp?fit=1200%2C746&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":89316,"url":"https:\/\/pureinfotech.com\/automatically-delete-files-downloads-folder-windows-10\/","url_meta":{"origin":93432,"position":3},"title":"How to automatically delete files in the Downloads folder on Windows 10","author":"Mauro Huculak","date":"June 13, 2017","format":false,"excerpt":"Windows 10 can now free up space by automatically deleting those junk files in the Downloads folder \u2014 Here's how to enable the feature.","rel":"","context":"","block_context":{"text":"Windows","link":"https:\/\/pureinfotech.com\/category\/windows\/"},"img":{"alt_text":"Delete files in the Downloads folder automatically on Windows 10","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/06\/delete-files-downloads-folder-windows-10.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/06\/delete-files-downloads-folder-windows-10.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/06\/delete-files-downloads-folder-windows-10.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/06\/delete-files-downloads-folder-windows-10.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2017\/06\/delete-files-downloads-folder-windows-10.jpg?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":138620,"url":"https:\/\/pureinfotech.com\/delete-temporary-files-windows-11\/","url_meta":{"origin":93432,"position":4},"title":"How to delete temporary files on Windows 11","author":"Mauro Huculak","date":"November 10, 2023","format":false,"excerpt":"Is your computer running out of space? If so, Windows 11 has a few ways to remove those temporary files wasting space on the main drive.","rel":"","context":"","block_context":{"text":"Windows","link":"https:\/\/pureinfotech.com\/category\/windows\/"},"img":{"alt_text":"Windows 11 delete temp files","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/05\/Windows-11-delete-temp-files-hero.webp?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/05\/Windows-11-delete-temp-files-hero.webp?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/05\/Windows-11-delete-temp-files-hero.webp?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/05\/Windows-11-delete-temp-files-hero.webp?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/05\/Windows-11-delete-temp-files-hero.webp?fit=1200%2C750&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":86533,"url":"https:\/\/pureinfotech.com\/remove-temporary-files-windows-10\/","url_meta":{"origin":93432,"position":5},"title":"How to remove temporary files on Windows 10","author":"Mauro Huculak","date":"December 15, 2022","format":false,"excerpt":"Are you running out of storage space? Windows 10 has a few ways to remove those temporary files wasting space on your computer.","rel":"","context":"","block_context":{"text":"Features","link":"https:\/\/pureinfotech.com\/category\/features\/"},"img":{"alt_text":"Windows 10 remove temporary files","src":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/windows-10-remove-temporary-files-hero.webp?fit=1200%2C744&quality=78&strip=all&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/windows-10-remove-temporary-files-hero.webp?fit=1200%2C744&quality=78&strip=all&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/windows-10-remove-temporary-files-hero.webp?fit=1200%2C744&quality=78&strip=all&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/windows-10-remove-temporary-files-hero.webp?fit=1200%2C744&quality=78&strip=all&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/pureinfotech.com\/wp-content\/uploads\/2022\/01\/windows-10-remove-temporary-files-hero.webp?fit=1200%2C744&quality=78&strip=all&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/posts\/93432","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/comments?post=93432"}],"version-history":[{"count":0,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/posts\/93432\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/media\/155413"}],"wp:attachment":[{"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/media?parent=93432"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/categories?post=93432"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pureinfotech.com\/wp-json\/wp\/v2\/tags?post=93432"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}