Skip to content

Instantly share code, notes, and snippets.

@rajanm
Last active August 22, 2019 15:35
Show Gist options
  • Save rajanm/e73bf7ae6ccea598296ea3f7ee848a07 to your computer and use it in GitHub Desktop.
Save rajanm/e73bf7ae6ccea598296ea3f7ee848a07 to your computer and use it in GitHub Desktop.
DOS batch file utility to rename files in bulk.
@echo off
rem Name: Bulk File Rename
rem DOS batch file utility to rename files in bulk.
setlocal enableDelayedExpansion
set /p "string1=Enter the character sequence to be replaced in the filename: "
set /p "string2=Enter the new character sequence in the filename: "
for %%F in (*%string1%*.*) do (
set "filename=%%F"
ren "!filename!" "!filename:%string1%=%string2%!"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment