title: DeleteFile with Permission Denied
body: <p>I'm running into and issue that has many entries on Stack Overflow, but none of them solved my problem.</p>
  
  <p>I have this piece of code, which tries to delete every .txt in a folder, but I keep getting a permission denied error on the "DeleteFile" command:</p>
  
  <pre><code>directory = "C:\TEST\FOLDER"
  
  Set fso = CreateObject("Scripting.FileSystemObject")
      Function DeleteTXTs
          For Each f In fso.GetFolder(directory).Files
              If LCase(fso.GetExtensionName(f)) = "txt" Then
                  fso.DeleteFile("C:\TEST\FOLDER\*.txt"),DeleteReadOnly
              End If
          Next
      End Function
  </code></pre>
  
  <p>My permissions on the "C:\TEST" and subfolders are of full control to every account that exists in windows... What could I do?</p>