Skip to content

Instantly share code, notes, and snippets.

@lrckt
Created April 8, 2025 01:45
Show Gist options
  • Save lrckt/bb8891f485129db0dc0cdc019e811d12 to your computer and use it in GitHub Desktop.
Save lrckt/bb8891f485129db0dc0cdc019e811d12 to your computer and use it in GitHub Desktop.
@echo off
setlocal enabledelayedexpansion
:: Change to your target folder
cd /d "C:\Path\To\Your\Folder"
for %%F in (*_*.dll) do (
set "filename=%%~nF"
set "ext=%%~xF"
:: Remove the trailing underscore and numbers
for /f "tokens=1 delims=_" %%A in ("!filename!") do (
ren "%%F" "%%A!ext!"
echo Renamed "%%F" to "%%A!ext!"
)
)
endlocal
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment