title: Batch programing to rename files
body: <p>I would like to rename files using batch script.</p>
  
  <p>The files are currently named like this:</p>
  
  <pre><code>pkg_mon_doc_kpps_01.html
  pkg_mon_doc_kpps_10.html
  pkg_mon_doc_kpps_02.html
  </code></pre>
  
  <p>And I'd like to change them to:</p>
  
  <pre><code>data_1.xls
  data_2.xls
  data_3.xls
  </code></pre>
  
  <p>I made batch file, and when  I ran the script, renaming successfully but with a warning</p>
  
  <p><strong>My batch script :</strong></p>
  
  <pre><code>@echo off
  set count=0
  :: Getting number of files
  for %%x in (folder\*.html) do (set /a count+=1)
  
  :: Renaming files
  for /l %%a in (1,1,%count%) do (ren folder\*.html data_%%a.xls)
  pause
  </code></pre>
  
  <p><strong>Warning</strong> </p>
  
  <pre><code>A duplicate file name exists, or the file cannot be found.
  A duplicate file name exists, or the file cannot be found.
  A duplicate file name exists, or the file cannot be found.
  Press any key to continue . . .
  </code></pre>
  
  <p>what's wrong? thanks before :)</p>