title: How to mass rename files with multiple dots in Batch file?
body: <p>I have the following folders structure:</p>
  
  <pre><code>C:\Database
  C:\Database\Tables
  C:\Database\Stored Procedures
  C:\Database\Views
  C:\Database\Functions
  </code></pre>
  
  <p>There will lots of files in each of the <strong>Tables</strong>, <strong>Stored Procedures</strong>, <strong>Views</strong> and <strong>Functions</strong> folders of the following format:</p>
  
  <p>Under the <strong>Tables</strong> folder:</p>
  
  <pre><code>dbo.Table1Name.Table.sql
  dbo.Table2Name.Table.sql
  mon.Table3Name.Table.sql
  test.Table4Name.Table.sql
  </code></pre>
  
  <p>Under the <strong>Stored Procedures</strong> folder:</p>
  
  <pre><code>dbo.usp_StoredProcedure1Name.StoredProcedure.sql
  dbo.usp_StoredProcedure2Name.StoredProcedure.sql
  dbo.usp_StoredProcedure3Name.StoredProcedure.sql
  mon.usp_StoredProcedure4Name.StoredProcedure.sql
  mon.usp_StoredProcedure5Name.StoredProcedure.sql
  </code></pre>
  
  <p>and likewise for <strong>Views</strong> and <strong>Functions</strong>.</p>
  
  <p>The files under the <strong>Tables</strong> folder would then be renamed to:</p>
  
  <pre><code>dbo.Table1Name.sql
  dbo.Table2Name.sql
  mon.Table3Name.sql
  test.Table4Name.sql
  </code></pre>
  
  <p>And the name of files under the <strong>Stored Procedures</strong> folder would then be:</p>
  
  <pre><code>dbo.usp_StoredProcedure1Name.sql
  dbo.usp_StoredProcedure2Name.sql
  dbo.usp_StoredProcedure3Name.sql
  mon.usp_StoredProcedure4Name.sql
  mon.usp_StoredProcedure5Name.sql
  </code></pre>
  
  <p>Ideally, I'd have a batch file in the Database folder that renames the files that remove <strong><em>Table</em></strong>, <strong><em>StoredProcedure</em></strong>, <strong><em>View</em></strong> and <strong><em>Function</em></strong> from the name of the files in their respective folders.</p>
  
  <p>If it can't be easily done in Batch file, I'd try to find something in PowerShell. </p>
  
  <p>Thanks Alex K for editing my original post (my first post) and thanks foxidrive for your recomendation and KnightWhoSayNi sharing your way.</p>