<?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: VBA: List of all files contained within a Directory</title>
	<atom:link href="http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/</link>
	<description>Everything Excel. Only Excel.</description>
	<lastBuildDate>Mon, 21 Nov 2011 07:25:47 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: defcon</title>
		<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/comment-page-1/#comment-2126</link>
		<dc:creator>defcon</dc:creator>
		<pubDate>Thu, 30 Jun 2011 12:07:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.automateexcel.com/?p=888#comment-2126</guid>
		<description>Dim Row_No As Integer
Dim No_Of_Files As Integer
Dim kk25 As Integer
Dim File_Path As String
Dim sPingcmd As String
Dim taskID

File_Path = Sheets(&quot;Sheet1&quot;).Range(&quot;A1&quot;).Value



Row_No = 36

Range(&quot;A3:A500&quot;).Clear

&#039;Lists all the files in the current directory

With Application.FileSearch
.NewSearch
.LookIn = File_Path
.Filename = &quot;*.*&quot;
.SearchSubFolders = True
.Execute

    No_Of_Files = .FoundFiles.Count

    For kk25 = 1 To No_Of_Files
        If InStr(1, .FoundFiles(kk25), &quot;[www.songs.pk]&quot;) &gt; 0 Then
            Worksheets(&quot;Sheet1&quot;).Cells(kk25 + 2, 1).Value = .FoundFiles(kk25)
       End If
    Next kk25

End With


For kk25 = 1 To No_Of_Files
    sPingcmd = Worksheets(&quot;Sheet1&quot;).Cells(kk25 + 2, 3).Value
    If sPingcmd  &quot;&quot; Then
       Call Shell(&quot;cmd /K &quot; &amp; sPingcmd, vbHide)
       
       If kk25 &gt; 9 And kk25 Mod 10 = 0 Then
        Call Shell(&quot;cmd /K taskkill /IM cmd.exe &quot;, vbHide)
       End If
       
    End If
Next kk25

 Call Shell(&quot;cmd /K taskkill /IM cmd.exe &quot;, vbHide)

=IF(ISERROR(FIND(&quot;[www.songs.pk]&quot;,A3,1)),&quot;&quot;,SUBSTITUTE(A3,LEFT(A3,FIND(&quot;[www.songs.pk]&quot;,A3,1) + 13),&quot;&quot;))

=IF(A3=&quot;&quot;,&quot;&quot;,CONCATENATE(&quot;ren &quot;,&quot;&quot;&quot;&quot; &amp; A3 &amp; &quot;&quot;&quot;&quot;, &quot; &quot;, &quot;&quot;&quot;&quot; &amp; B3 &amp; &quot;&quot;&quot;&quot;))</description>
		<content:encoded><![CDATA[<p>Dim Row_No As Integer<br />
Dim No_Of_Files As Integer<br />
Dim kk25 As Integer<br />
Dim File_Path As String<br />
Dim sPingcmd As String<br />
Dim taskID</p>
<p>File_Path = Sheets(&#8220;Sheet1&#8243;).Range(&#8220;A1&#8243;).Value</p>
<p>Row_No = 36</p>
<p>Range(&#8220;A3:A500&#8243;).Clear</p>
<p>&#8216;Lists all the files in the current directory</p>
<p>With Application.FileSearch<br />
.NewSearch<br />
.LookIn = File_Path<br />
.Filename = &#8220;*.*&#8221;<br />
.SearchSubFolders = True<br />
.Execute</p>
<p>    No_Of_Files = .FoundFiles.Count</p>
<p>    For kk25 = 1 To No_Of_Files<br />
        If InStr(1, .FoundFiles(kk25), &#8220;[www.songs.pk]&#8220;) &gt; 0 Then<br />
            Worksheets(&#8220;Sheet1&#8243;).Cells(kk25 + 2, 1).Value = .FoundFiles(kk25)<br />
       End If<br />
    Next kk25</p>
<p>End With</p>
<p>For kk25 = 1 To No_Of_Files<br />
    sPingcmd = Worksheets(&#8220;Sheet1&#8243;).Cells(kk25 + 2, 3).Value<br />
    If sPingcmd  &#8220;&#8221; Then<br />
       Call Shell(&#8220;cmd /K &#8221; &amp; sPingcmd, vbHide)</p>
<p>       If kk25 &gt; 9 And kk25 Mod 10 = 0 Then<br />
        Call Shell(&#8220;cmd /K taskkill /IM cmd.exe &#8220;, vbHide)<br />
       End If</p>
<p>    End If<br />
Next kk25</p>
<p> Call Shell(&#8220;cmd /K taskkill /IM cmd.exe &#8220;, vbHide)</p>
<p>=IF(ISERROR(FIND(&#8220;[www.songs.pk]&#8220;,A3,1)),&#8221;",SUBSTITUTE(A3,LEFT(A3,FIND(&#8220;[www.songs.pk]&#8220;,A3,1) + 13),&#8221;"))</p>
<p>=IF(A3=&#8221;",&#8221;",CONCATENATE(&#8220;ren &#8220;,&#8221;"&#8221;" &amp; A3 &amp; &#8220;&#8221;"&#8221;, &#8221; &#8220;, &#8220;&#8221;"&#8221; &amp; B3 &amp; &#8220;&#8221;"&#8221;))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Badminton</title>
		<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/comment-page-1/#comment-1976</link>
		<dc:creator>Badminton</dc:creator>
		<pubDate>Thu, 10 Feb 2011 19:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.automateexcel.com/?p=888#comment-1976</guid>
		<description>Thanks for pointing out Scripting.FileSystemObject guys.</description>
		<content:encoded><![CDATA[<p>Thanks for pointing out Scripting.FileSystemObject guys.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Walkenbach</title>
		<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/comment-page-1/#comment-863</link>
		<dc:creator>John Walkenbach</dc:creator>
		<pubDate>Sun, 14 Sep 2008 00:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.automateexcel.com/?p=888#comment-863</guid>
		<description>Keep in mind that the FileSearch object is no longer available in Office 2007. So this code works only with earlier versions.

You can use the old Dir command or FileSystemObject.</description>
		<content:encoded><![CDATA[<p>Keep in mind that the FileSearch object is no longer available in Office 2007. So this code works only with earlier versions.</p>
<p>You can use the old Dir command or FileSystemObject.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Randy Harmelink</title>
		<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/comment-page-1/#comment-862</link>
		<dc:creator>Randy Harmelink</dc:creator>
		<pubDate>Sun, 14 Sep 2008 00:37:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.automateexcel.com/?p=888#comment-862</guid>
		<description>Just to note that Application.FileSearch no longer exists in EXCEL 2007.</description>
		<content:encoded><![CDATA[<p>Just to note that Application.FileSearch no longer exists in EXCEL 2007.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JP</title>
		<link>http://www.automateexcel.com/2008/09/13/vba-list-of-all-files-contained-within-a-directory/comment-page-1/#comment-859</link>
		<dc:creator>JP</dc:creator>
		<pubDate>Sat, 13 Sep 2008 18:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.automateexcel.com/?p=888#comment-859</guid>
		<description>Keep in mind this will only work pre-Excel 2007. Check out the Scripting.FileSystemObject for a way you can do this in all Excel versions.


-JP</description>
		<content:encoded><![CDATA[<p>Keep in mind this will only work pre-Excel 2007. Check out the Scripting.FileSystemObject for a way you can do this in all Excel versions.</p>
<p>-JP</p>
]]></content:encoded>
	</item>
</channel>
</rss>

