title: Remove last 4 characters of a file in a folder with a batch file
body: <p>this should be pretty simple, i just want a bat file that when placed in a folder will rename all files within the folder and delete the final 4 characters, but not the extension</p>
  <p>ex.</p>
  <pre><code>img (1).jpg
  </code></pre>
  <p>becomes</p>
  <pre><code>img.jpg
  </code></pre>
  <p>ive tried</p>
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  if not exist %1 goto :eof
  for /f %%A in ('find /V /C &quot;&quot; ^&lt;%1') do set lines=%%A
  for /f &quot;tokens=1,* delims=[]&quot; %%A in ('find /V /N &quot;&quot; ^&lt;%1') do (
  if %%A LSS %lines% (
  echo %%B
  ) else (
  set rec=%%B
  echo !rec:~0,-4!
  )
  )
  </code></pre>
  <p>but it doesnt work. theres no error, it runs, it just doesnt do anything</p>