title: Using VBScript to find most recent file date in a single folder
body: <p>How could I modify this VBScript to return only the newest file's name and Last Modified date?  Currently it returns anything modified in the last 24 hours.  I want to look for the most recent file only.  I borrowed this from StackOverflow, not yet a VBScript wizard.</p>
  
  <pre><code>option explicit  
  dim fileSystem, folder, file
  dim path   
  path = "C:\test"  
  Set fileSystem = CreateObject("Scripting.FileSystemObject") 
  Set folder = fileSystem.GetFolder(path) 
  for each file in folder.Files         
  if file.DateLastModified &gt; dateadd("h", -24, Now) then         
  'whatever you want to do to process'         
  WScript.Echo file.Name &amp; " last modified at " &amp; file.DateLastModified     
  end if
  next 
  </code></pre>