title: what is the best way to delete 1000's of folders based on created date?
body: <p>I have a task to do on the 30th of this month that requires me to manually go through thousands of folders in a directory and delete any and all folders and files in the folders that were created on a certain date. </p>
  
  <p>I'm thinking i can write a quick program that will handle this for me. I have a winform with a text box for my UNC path, a date time picker to pass the date through and a button to delete the files. so far I just have this and I want to be sure that I'm on the right path. </p>
  
  <pre><code>Imports System.IO
  
  Public Class FormMain
  
      Private Sub btn_DeleteFolders_Click(sender As Object, e As EventArgs) Handles btn_DeleteFolders.Click
          Dim UNC As String = tb_UNC.Text
          Dim FDate As String = dt_FolderDate.Value.Date
          Dim FPath As New System.IO.DirectoryInfo(UNC)
          Dim CreatedDate As String = way to find the created date of a folder??
          'MessageBox.Show(FPath)
  
          For Each f As String In Directory.EnumerateFiles(UNC, FDate, SearchOption.AllDirectories)
              If FDate = CreatedDate Then
  
                  File.Delete(UNC)
  
              End If
          Next
  
      End Sub
  End Class
  </code></pre>
  
  <p>any help would be awesome!!! Thank you!</p>