<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Vb.Net - Delete an existing file using a &amp;quot;Wildcard&amp;quot; in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vb-net-delete-an-existing-file-using-a-quot-wildcard-quot/m-p/11590019#M145880</link>
    <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;You have to create a Directory Info object using the path of the folder that contains files you want to delete. And look for all files inside of it "Test*.text"&lt;/P&gt;&lt;P&gt;If you want to look for all sub folders, You can use this:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim dinfo As New DirectoryInfo(YOUR_FOLDER_PATH)
For Each myFile In dinfo.GetFiles("Test*.txt", SearchOption.AllDirectories)
    File.Delete(myFile)
Next &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;If you want to check only the folder you entered, not the subfolders then you have to change "SearchOption.AllDirectories" to "SearchOption.TopDirectoryOnly".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope it will help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Devrim&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Dec 2022 07:57:08 GMT</pubDate>
    <dc:creator>Dev_rim</dc:creator>
    <dc:date>2022-12-01T07:57:08Z</dc:date>
    <item>
      <title>Vb.Net - Delete an existing file using a "Wildcard"</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vb-net-delete-an-existing-file-using-a-quot-wildcard-quot/m-p/11589886#M145873</link>
      <description>&lt;P&gt;Can anybody help?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am writing a Vb.Net "Addin" for Inventor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to delete an existing file using a "Wildcard", but, I have tried various solutions but none seem to work!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For example:&lt;/P&gt;&lt;P&gt;Say I have a file called "Test123456.txt" and I want to delete it using the wildcard "Test*.txt" (* being the Wildcard).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Can anybody tell me how to do this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Darren&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 06:45:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vb-net-delete-an-existing-file-using-a-quot-wildcard-quot/m-p/11589886#M145873</guid>
      <dc:creator>isocam</dc:creator>
      <dc:date>2022-12-01T06:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: Vb.Net - Delete an existing file using a "Wildcard"</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/vb-net-delete-an-existing-file-using-a-quot-wildcard-quot/m-p/11590019#M145880</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;You have to create a Directory Info object using the path of the folder that contains files you want to delete. And look for all files inside of it "Test*.text"&lt;/P&gt;&lt;P&gt;If you want to look for all sub folders, You can use this:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim dinfo As New DirectoryInfo(YOUR_FOLDER_PATH)
For Each myFile In dinfo.GetFiles("Test*.txt", SearchOption.AllDirectories)
    File.Delete(myFile)
Next &lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;If you want to check only the folder you entered, not the subfolders then you have to change "SearchOption.AllDirectories" to "SearchOption.TopDirectoryOnly".&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I hope it will help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Devrim&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Dec 2022 07:57:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/vb-net-delete-an-existing-file-using-a-quot-wildcard-quot/m-p/11590019#M145880</guid>
      <dc:creator>Dev_rim</dc:creator>
      <dc:date>2022-12-01T07:57:08Z</dc:date>
    </item>
  </channel>
</rss>

