Need help renaming large amounts of files
Posted: 27 Mar 2010 19:27
I need to rename files that have "&" in the name and replace with "and". I'm using dir /s /a | find /i "&" to find all of the file names.
Thanks
Thanks
A Forum all about DOS Batch
https://www.dostips.com/forum/
Code: Select all
@echo off &setlocal
for /f "delims=" %%a in ('dir /b /s^|findstr /c:"&"') do set "fullname=%%a" &set "name=%%~nxa" &call :process
pause
goto :eof
:process
set "newname=%name:&=and%"
ren "%fullname%" "%newname%"
goto :eof