title: Removing part of filename with batch
body: <p>I've tried to tweak a lot of the code provided to similar questions, but I don't think the solution is posted. My problem is that the part from where I want to remove the rest exists 2 times before the last!</p>
  
  <p>What I have is a folder with:</p>
  
  <pre><code>number1-number2-number3 - some random text about the file.filetype
  </code></pre>
  
  <p><em>number1</em> will range from 01 to 99<br>
  <em>number2</em> will range from 1-99999<br>
  <em>number3</em> will range from 1-999 with the possibility of 2 decimals, separated from whole number by .      </p>
  
  <p>Example folder <code>c:\temp\</code>:</p>
  
  <pre><code>15-1592-1 - file 1.doc
  15-1592-2 - this is file2.pdf
  15-1592-3 - this cointains subfiles.html
  15-1592-3.1 - sub1.jpg
  15-1592-3.2 - sub2.pdf
  </code></pre>
  
  <p>What I need is a folder where everything after the end of <em>number3</em> is removed from the filename, but also the file type unaltered.</p>
  
  <p>Example:</p>
  
  <pre><code>15-1592-1.doc
  15-1592-2.pdf
  15-1592-3.html
  15-1592-3.1.jpg
  </code></pre>
  
  <p>I understand this is quiet possible from reading all the answers combined.</p>
  
  <p>What I lack is the knowledge to compile it all!</p>