<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" > <channel><title>Comments on: Delete Files Older Than Date Using Batch Files</title> <atom:link href="http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/feed/" rel="self" type="application/rss+xml" /><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/</link> <description>Tech, Love, Life</description> <lastBuildDate>Thu, 11 Aug 2011 02:51:22 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>By: ObiWanKenobi</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-69210</link> <dc:creator>ObiWanKenobi</dc:creator> <pubDate>Tue, 12 Jul 2011 09:05:00 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-69210</guid> <description>I use FileDestroyer http://sourceforge.net/projects/filedestroyer/Here is a short tutorial:http://arturito.net/2010/07/13/file-destroyer-clean-upfree-up-disk-space-and-deleting-files-or-folders-after-a-certain-period-of-time/Usage: FileDestroyer.exe -scan “D:\SQLBackup” -ext bak -log “D:\Logs\” –days 2This command scans folder “D:\SQLBackup” looks for extension .bak and removes backups/files older than 2 days and it logs everything in D:\Logs\It also supports UNC Paths (\\server1\shared\backups\)(Disclaimer: I&#039;m the author of this utility)</description> <content:encoded><![CDATA[<p>I use FileDestroyer<br /> <a href="http://sourceforge.net/projects/filedestroyer/" rel="nofollow">http://sourceforge.net/projects/filedestroyer/</a></p><p>Here is a short tutorial:</p><p><a href="http://arturito.net/2010/07/13/file-destroyer-clean-upfree-up-disk-space-and-deleting-files-or-folders-after-a-certain-period-of-time/" rel="nofollow">http://arturito.net/2010/07/13/file-destroyer-clean-upfree-up-disk-space-and-deleting-files-or-folders-after-a-certain-period-of-time/</a></p><p>Usage:</p><p>FileDestroyer.exe -scan “D:\SQLBackup” -ext bak -log “D:\Logs\” –days 2</p><p>This command scans folder “D:\SQLBackup” looks for extension .bak and removes backups/files older than 2 days and it logs everything in D:\Logs\</p><p>It also supports UNC Paths (\\server1\shared\backups\)</p><p>(Disclaimer: I&#8217;m the author of this utility)</p> ]]></content:encoded> </item> <item><title>By: Mike-Win2003Server</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-63350</link> <dc:creator>Mike-Win2003Server</dc:creator> <pubDate>Thu, 09 Jun 2011 23:36:20 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-63350</guid> <description>This worked for me Win 2003 Server:REM displays all the files older than 180 days from the X:\exene folder FORFILES /P X:\exene  /M *.xml  /S /D -180 /C &quot;cmd /c echo @file&quot;REM deletes all the files older than 180 days from the X:\exene folder FORFILES /P X:\exene  /M *.xml  /S /D -180 /C &quot;cmd /c del @file&quot;</description> <content:encoded><![CDATA[<p>This worked for me Win 2003 Server:</p><p>REM displays all the files older than 180 days from the X:\exene folder<br /> FORFILES /P X:\exene  /M *.xml  /S /D -180 /C &#8220;cmd /c echo @file&#8221;</p><p>REM deletes all the files older than 180 days from the X:\exene folder<br /> FORFILES /P X:\exene  /M *.xml  /S /D -180 /C &#8220;cmd /c del @file&#8221;</p> ]]></content:encoded> </item> <item><title>By: Frustrated Tech</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-58154</link> <dc:creator>Frustrated Tech</dc:creator> <pubDate>Tue, 03 May 2011 17:20:57 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-58154</guid> <description>Forfiles -pC:\backup -s -m*.* -d-5 -c &quot;cmd /c del /q @path&quot;Worked great for me.  Saved my life!  Thanks a ton.</description> <content:encoded><![CDATA[<p>Forfiles -pC:\backup -s -m*.* -d-5 -c &#8220;cmd /c del /q @path&#8221;</p><p>Worked great for me.  Saved my life!  Thanks a ton.</p> ]]></content:encoded> </item> <item><title>By: Stan</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-55753</link> <dc:creator>Stan</dc:creator> <pubDate>Thu, 14 Apr 2011 16:35:26 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-55753</guid> <description>I had the same problem but I get it resolved once I removed the &quot;echo&quot; word from the command line. It should work nicely.</description> <content:encoded><![CDATA[<p>I had the same problem but I get it resolved once I removed the &#8220;echo&#8221; word from the command line. It should work nicely.</p> ]]></content:encoded> </item> <item><title>By: The Database Zealot</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-53007</link> <dc:creator>The Database Zealot</dc:creator> <pubDate>Thu, 24 Mar 2011 22:31:27 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-53007</guid> <description>@Rons - I use this to delete files with no extension:forfiles /p D:\backups /s /d -5 /c “cmd /c del /q @PATH\@FILE”</description> <content:encoded><![CDATA[<p>@Rons &#8211; I use this to delete files with no extension:</p><p>forfiles /p D:\backups /s /d -5 /c “cmd /c del /q @PATH\@FILE”</p> ]]></content:encoded> </item> <item><title>By: Matt</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-52852</link> <dc:creator>Matt</dc:creator> <pubDate>Wed, 23 Mar 2011 19:46:58 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-52852</guid> <description>Previous comment says no spaces, in these cases using quotes fixing that issue.FORFILES /P &quot;C:\TEST\TEST\TEST&quot; /M *.dat /D -5 /C &quot;cmd /c del /q @PATH&quot;For those of you from other languages might like this batch function method.  Basically you do a call to the label %1 is first argument.  You don&#039;t leave the batch file...  Fun Trick.CALL:DELETE &quot;C:\test&quot;GOTO:EOF:DELETEDEL /q %1GOTO:EOF</description> <content:encoded><![CDATA[<p>Previous comment says no spaces, in these cases using quotes fixing that issue.</p><p>FORFILES /P &#8220;C:\TEST\TEST\TEST&#8221; /M *.dat /D -5 /C &#8220;cmd /c del /q @PATH&#8221;</p><p>For those of you from other languages might like this batch function method.  Basically you do a call to the label %1 is first argument.  You don&#8217;t leave the batch file&#8230;  Fun Trick.</p><p>CALL:DELETE &#8220;C:\test&#8221;</p><p>GOTO:EOF</p><p> <img src='http://scottelkin.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ELETE</p><p>DEL /q %1</p><p>GOTO:EOF</p> ]]></content:encoded> </item> <item><title>By: delete files older than x days &#124; andrewlaihk</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-51925</link> <dc:creator>delete files older than x days &#124; andrewlaihk</dc:creator> <pubDate>Wed, 16 Mar 2011 15:12:28 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-51925</guid> <description>[...] http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/ [...]</description> <content:encoded><![CDATA[<p>[...] <a href="http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/" rel="nofollow">http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/</a> [...]</p> ]]></content:encoded> </item> <item><title>By: Rons</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-47306</link> <dc:creator>Rons</dc:creator> <pubDate>Mon, 14 Feb 2011 21:37:23 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-47306</guid> <description>I&#039;m having issues trying to delete files with no extension.  The ForFiles batch file seems to skip if I just do *.*.  I tried specifing a file typ and got rid of the /M switch and then I get prompted if I&#039;m sure I want to delete wit a Yes/No.  having to input Yes/No invalidates the batch process.  How can I modify this to delete files with no extension?</description> <content:encoded><![CDATA[<p>I&#8217;m having issues trying to delete files with no extension.  The ForFiles batch file seems to skip if I just do *.*.  I tried specifing a file typ and got rid of the /M switch and then I get prompted if I&#8217;m sure I want to delete wit a Yes/No.  having to input Yes/No invalidates the batch process.  How can I modify this to delete files with no extension?</p> ]]></content:encoded> </item> <item><title>By: Howard</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-45602</link> <dc:creator>Howard</dc:creator> <pubDate>Mon, 31 Jan 2011 23:30:51 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-45602</guid> <description>After several attempts, I noticed that the command switches may need to be in upper case. (The command failed out right for me until I made this change.)</description> <content:encoded><![CDATA[<p>After several attempts, I noticed that the command switches may need to be in upper case. (The command failed out right for me until I made this change.)</p> ]]></content:encoded> </item> <item><title>By: Nico57</title><link>http://scottelkin.com/programming/delete-files-older-than-date-using-batch-files/comment-page-1/#comment-45591</link> <dc:creator>Nico57</dc:creator> <pubDate>Mon, 31 Jan 2011 21:59:45 +0000</pubDate> <guid isPermaLink="false">/archive/2007/04/13/Delete-Files-Older-Than-Date-Using-Batch-Files.aspx#comment-45591</guid> <description>Didn&#039;t know about forfiles either... It&#039;s a very welcome addition to my admin toolkit.Regarding this command line, spawning a new cmd.exe on each file delete sounds like overkill. I&#039;d rather type:for /f %a in (&#039;forfiles /p C:\backup /s /d -5&#039;) do del %a</description> <content:encoded><![CDATA[<p>Didn&#8217;t know about forfiles either&#8230;<br /> It&#8217;s a very welcome addition to my admin toolkit.</p><p>Regarding this command line, spawning a new cmd.exe on each file delete sounds like overkill.<br /> I&#8217;d rather type:</p><p>for /f %a in (&#8216;forfiles /p C:\backup /s /d -5&#8242;) do del %a</p> ]]></content:encoded> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)

Served from: scottelkin.com @ 2012-02-11 05:20:54 -->
