Answers for "batch rename files in subfolders"

0

batch rename files in subfolders

REM # |EXAMPLE: Replace ")" with "_" within the filenames in the current directory AND its subdirectories  
@echo off
setlocal EnableDelayedExpansion

set "pattern_to_replace=)"
set "replace_text=_"

for /R "%cd%" %%N in ("*") do (
	set "InitName=%%~nN%%~xN"
	call set NewName=%%InitName:!pattern_to_replace!=!replace_text!%%
	rename "%%~dN\%%~pN!InitName!" "!NewName!"
)

@echo on
Posted by: Guest on July-06-2020

Code answers related to "batch rename files in subfolders"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language