<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Hey, Scripting Guy! How Can I Get a List of All the Subfolders in a Folder and Then Put That List Into an Array?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2007/01/27/how-can-i-get-a-list-of-all-the-subfolders-in-a-folder-and-then-put-that-list-into-an-array.aspx</link><description>Hey, Scripting Guy! How can I get a list of all the subfolders in a folder and then put that list into an array? -- PW 
 
 Hey, PW. We know how anxious you&amp;rsquo;ve all been, waiting to hear whether the Scripting Guys were successfully moved from Building</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Hey, Scripting Guy! How Can I Get a List of All the Subfolders in a Folder and Then Put That List Into an Array?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2007/01/27/how-can-i-get-a-list-of-all-the-subfolders-in-a-folder-and-then-put-that-list-into-an-array.aspx#3499156</link><pubDate>Mon, 21 May 2012 21:07:48 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3499156</guid><dc:creator>Me-Cyclist</dc:creator><description>&lt;p&gt;Hey Scripting Guy,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m trying to use this script as a base for doing a file level inventory. &amp;nbsp;I&amp;#39;d like to export the following attributes of all files under a certain directory structure so our Security and change management folks can be made aware of when a file changes.&lt;/p&gt;
&lt;p&gt;I can easily get the file attributes of a simple directory, but obviously I need to include this recursive subroutine as well&lt;/p&gt;
&lt;p&gt;Dim fso, folder, files, OutputFile&lt;/p&gt;
&lt;p&gt;Dim strPath&lt;/p&gt;
&lt;p&gt;strComputer=&amp;quot;.&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;#39; Create a FileSystemObject &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Set fso = CreateObject(&amp;quot;Scripting.FileSystemObject&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;#39; Define folder we want to list files from&lt;/p&gt;
&lt;p&gt;strPath = &amp;quot;C:\MyFolder&amp;quot;&lt;/p&gt;
&lt;p&gt;Set folder = fso.GetFolder(strPath)&lt;/p&gt;
&lt;p&gt;Set files = folder.Files&lt;/p&gt;
&lt;p&gt;&amp;#39; Create text file to output test data&lt;/p&gt;
&lt;p&gt;Set OutputFile = fso.CreateTextFile(strComputer &amp;amp; &amp;quot;_FileInventory.csv&amp;quot;, True)&lt;/p&gt;
&lt;p&gt;OutputFile.Write(&amp;quot;File Name&amp;quot; &amp;amp; &amp;quot;,&amp;quot; &amp;amp; &amp;quot;File Path&amp;quot; &amp;amp; &amp;quot;,&amp;quot; &amp;amp; &amp;quot;Date Last Modified&amp;quot;)&lt;/p&gt;
&lt;p&gt;OutputFile.Write(&amp;quot;,&amp;quot; &amp;amp; &amp;quot;Date Created&amp;quot; &amp;amp; &amp;quot;,&amp;quot;)&lt;/p&gt;
&lt;p&gt;OutputFile.WriteLine(&amp;quot;&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;#39; Loop through each file &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;#39;--------------------&lt;/p&gt;
&lt;p&gt;For each item In files&lt;/p&gt;
&lt;p&gt;&amp;#39; &amp;nbsp;Output file properties to a text file&lt;/p&gt;
&lt;p&gt; &amp;nbsp;OutputFile.Write(item.Name &amp;amp; &amp;quot;,&amp;quot; &amp;amp; item.Path &amp;amp; &amp;quot;,&amp;quot; &amp;amp; item.DateLastModified)&lt;/p&gt;
&lt;p&gt; &amp;nbsp;OutputFile.Writeline(&amp;quot;,&amp;quot; &amp;amp; item.DateCreated &amp;amp; &amp;quot;,&amp;quot; &amp;amp; item.DateLastAccessed)&lt;/p&gt;
&lt;p&gt;Next&lt;/p&gt;
&lt;p&gt;&amp;#39; Close text file&lt;/p&gt;
&lt;p&gt;OutputFile.Close&lt;/p&gt;
&lt;p&gt;HELP!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3499156" width="1" height="1"&gt;</description></item><item><title>re: Hey, Scripting Guy! How Can I Get a List of All the Subfolders in a Folder and Then Put That List Into an Array?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2007/01/27/how-can-i-get-a-list-of-all-the-subfolders-in-a-folder-and-then-put-that-list-into-an-array.aspx#3436701</link><pubDate>Tue, 21 Jun 2011 21:20:58 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3436701</guid><dc:creator>Poonkie</dc:creator><description>&lt;p&gt;I found that if a directory has an apostrophe (&amp;#39;) in the name, the process stops there.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3436701" width="1" height="1"&gt;</description></item></channel></rss>