title: Using VB Script, how do I automate the creation of an Excel file containing a list of files from a specific folder?
body: <p>I have searched the web but cannot find a specific answer to the following.</p>
  
  <p>What I do know: (1) a txt file of a list of files in S:\Rally can be created from cmd at the S:\Rally prompt:</p>
  
  <pre><code>dir/b&gt;H:\Home\list1.txt
  </code></pre>
  
  <p>(2) A new Excel file can be opened by saving the following as .vbs:</p>
  
  <pre><code>Set objExcel = CreateObject("Excel.Application")
  objExcel.Visible = True
  
  objExcel.Workbooks.Add
  </code></pre>
  
  <p>Then run it in cmd (say the .vbs file is saved as C:\Scripts\openex1.vbs):</p>
  
  <pre><code>cscript C:\Scripts\openex1.vbs
  </code></pre>
  
  <p>What I don't know is (1) how to put these together so that an Excel file (instead of a txt file) is created with the resulting list of files from S:\Rally and (2) how to automate this, preferably to run at the end of each month, but I would be fine to just double click something or go into cmd and run it myself at the end of each month.</p>