title: Batch file that replace letters without extension
body: <p>I'm trying to create simple batch file that replaces letters from latin to cyrillic in jpg file name but i dont know how to stop the batch file from changing extensions. </p>
  
  <pre><code>@echo off
  chcp 65001
  Setlocal enabledelayedexpansion
  
  Set "Pattern=p"
  Set "Replace=п"
  
  For %%# in ("*.jpg") Do (
      Set "File=%%~nx#"
      Ren "%%#" "!File:%Pattern%=%Replace%!"
  )
  
  Pause&amp;Exit
  </code></pre>
  
  <p>This script changes name from p.jpg to п.jпg which is useless. 
  Any suggestion is welcome.</p>
  
  <p>Thank you</p>