title: Remove Last Characters from my filenames in windows
body: <p>Im quite new to batch programming and i wanted to remove the last characters on my filename.</p>
  
  <pre><code>10_myfile_12345_6789.txt
  11_myfile_12345_0987.txt
  </code></pre>
  
  <p>I want to remove the last 4 digits on my filename how i could do that?</p>
  
  <p>I have tried this</p>
  
  <pre><code>@echo off
  setlocal enabledelayedexpansion
  set X=3
  set FOLDER_PATH=
  pushd %FOLDER_PATH%
  for %%f in (*) do if %%f neq %~nx0 (
      set "filename=%%~nf"
      ren "%%f" "!filename!%%~xf"
  )
  popd
  PAUSE
  </code></pre>
  
  <p>but it removes on first and last characters, i only saw this here too, im still quite confused how this works</p>