title: jscript - getting list of files in directory
body: <p>This seems like it should be easy.  I've never used JScript before and I'm looking at the JScript api provided by microsoft but no luck.  Here's what I have:</p>
  
  <pre><code>    var fso, tf;
  fso = new ActiveXObject("Scripting.FileSystemObject");
  tf = fso.CreateTextFile("New Tracks.txt", true);
  var objShell = new ActiveXObject("Shell.Application");
  var lib;
  lib = objShell.BrowseForFolder(0,"Select Library Folder",0);
  items = lib.Items()
  for (i=0;i&lt;items.Count;i++)
  {
      fitem = items[i];
      tf.WriteLine(fitem.Name);
  }
  WScript.Echo("Done");
  tf.Close();
  </code></pre>
  
  <p>I get an error about fitem.Name that it's not an object or null or something.  However, there are definitely files in that folder.</p>