 




<?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 based on Size</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/delete-files-based-on-size/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/delete-files-based-on-size/</link>
	<description></description>
	<lastBuildDate>Wed, 22 May 2013 05:05:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: jennic</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/delete-files-based-on-size/#comment-70734</link>
		<dc:creator>jennic</dc:creator>
		<pubDate>Sat, 21 Nov 2009 20:38:01 +0000</pubDate>
		<guid isPermaLink="false">#comment-70734</guid>
		<description><![CDATA[Here is a script that will delete files in a folder that are smaller than the given number of bytes. The size in bytes and folder path are both arguments to the script.


&lt;pre&gt;# Script DeleteBySize.txt
var str folder, bytes, filelist, ssize
var int bytes, filesize

# Get the list of files in $folder.
lf -n &quot;*&quot; $folder ($ftype==&quot;f&quot;) &gt; $filelist
while ($filelist &lt;&gt; &quot;&quot;)
do

    # Get the next file from the list.
    lex &quot;1&quot; filelist &gt; $file

    # Get this file&#039;s size.
    lf -s $file &gt; $ssize ; set $filesize = makeint(str($ssize))

    # Is $filesize smaller than $bytes ?
    if ($filesize &lt;= $bytes)
    do
        # Delete this file.
        system del (&quot;&quot;&quot;+$file+&quot;&quot;&quot;)
    done
    endif
done&lt;/pre&gt;

Script is in biterscripting. Copy and paste the script into file C:/Scripts/DeleteBySize.txt, start biterscrpting, then copy and paste the following command into command area.

&lt;pre&gt;script &quot;C:/Scripts/DeleteBySize.txt&quot; folder(&quot;C:/testfolder&quot;) bytes(0)&lt;/pre&gt;

Above command will delete all files in folder &quot;C:/testfolder&quot; whose file size is 0.

&lt;pre&gt;script &quot;C:/Scripts/DeleteBySize.txt&quot; folder(&quot;C:/testfolder&quot;) bytes(100)&lt;/pre&gt;

will delete all files in folder &quot;C:/testfolder&quot; whose file size is less than or equal to 100.

etc.

Test the script first before using. The documentation for the lf (list files) command is at &lt;a href=&quot;http://www.biterscripting.com/helppages/lf.html&quot;&gt;http://www.biterscripting.com/helppages/lf.html&lt;/a&gt;  .]]></description>
		<content:encoded><![CDATA[<p>Here is a script that will delete files in a folder that are smaller than the given number of bytes. The size in bytes and folder path are both arguments to the script.</p>
<pre># Script DeleteBySize.txt
var str folder, bytes, filelist, ssize
var int bytes, filesize

# Get the list of files in $folder.
lf -n "*" $folder ($ftype=="f") &gt; $filelist
while ($filelist &lt;&gt; "")
do

    # Get the next file from the list.
    lex "1" filelist &gt; $file

    # Get this file's size.
    lf -s $file &gt; $ssize ; set $filesize = makeint(str($ssize))

    # Is $filesize smaller than $bytes ?
    if ($filesize &lt;= $bytes)
    do
        # Delete this file.
        system del ("""+$file+""")
    done
    endif
done</pre>
<p>Script is in biterscripting. Copy and paste the script into file C:/Scripts/DeleteBySize.txt, start biterscrpting, then copy and paste the following command into command area.</p>
<pre>script "C:/Scripts/DeleteBySize.txt" folder("C:/testfolder") bytes(0)</pre>
<p>Above command will delete all files in folder &#8220;C:/testfolder&#8221; whose file size is 0.</p>
<pre>script "C:/Scripts/DeleteBySize.txt" folder("C:/testfolder") bytes(100)</pre>
<p>will delete all files in folder &#8220;C:/testfolder&#8221; whose file size is less than or equal to 100.</p>
<p>etc.</p>
<p>Test the script first before using. The documentation for the lf (list files) command is at <a href="http://www.biterscripting.com/helppages/lf.html">http://www.biterscripting.com/helppages/lf.html</a>  .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: schmidtw</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/delete-files-based-on-size/#comment-70209</link>
		<dc:creator>schmidtw</dc:creator>
		<pubDate>Tue, 10 Nov 2009 22:00:00 +0000</pubDate>
		<guid isPermaLink="false">#comment-70209</guid>
		<description><![CDATA[Although I agree with Jutpro, you may want to check out some of the techniques listed here: &lt;a href=&quot;http://www.ericphelps.com/batch/samples/samples.htm&quot;&gt;Batch Help&lt;/a&gt;


Hope this helps!

-Schmidtw]]></description>
		<content:encoded><![CDATA[<p>Although I agree with Jutpro, you may want to check out some of the techniques listed here: <a href="http://www.ericphelps.com/batch/samples/samples.htm">Batch Help</a></p>
<p>Hope this helps!</p>
<p>-Schmidtw</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/10 queries in 0.041 seconds using memcached
Object Caching 281/287 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 10:17:24 -->