To add to Preet's answer, the following batch script renames all files that match a mask you pass in. You can either:
- Append a pattern to the end of the filename (
file1.dll
==> file1_a.dll
).
- Insert a pattern at the beginning of the filename (
file1.dll
==> a_file1.dll
).
- Replace the filename with a pattern and sequence number (
file1.dll
==> mydll_1.dll
; file2.dll
==> mydll_2.dll
).
RenameAll.bat
@echo OFF
setlocal
@echo.
set /p PATTERN="Enter text pattern to add to file names: "
@echo %PATTERN%
:GETLOC
@echo.
@echo (A)ppend pattern to end of filename
@echo (I)nsert pattern at beggining of filename
@echo (R)eplace filename with pattern and sequence number
@echo ---------
@echo (Q)uit
@echo.
set /p LOCATION="Enter choice: "
@echo %LOCATION%
if /I '%LOCATION%' equ 'A' goto FILELOOP
if /I '%LOCATION%' equ 'I' goto FILELOOP
if /I '%LOCATION%' equ 'R' goto FILELOOP
if /I '%LOCATION%' equ 'Q' goto END
@echo Choice %LOCATION% invalid, try again.
goto :GETLOC
SET /A SEQ_NO=0
:FILELOOP
@echo Renaming file %1...
if %1.==. goto END
@echo %1
SET /A SEQ_NO=SEQ_NO+1
if /I '%LOCATION%' equ 'A' for %%i in (%1) do ren %%i "%%~ni%PATTERN%%%~xi"
if /I '%LOCATION%' equ 'I' for %%i in (%1) do ren %%i "%PATTERN%%%~ni%%~xi"
if /I '%LOCATION%' equ 'R' for %%i in (%1) do ren %%i "%PATTERN%%SEQ_NO%%%~xi"
SHIFT
goto FILELOOP
:END
@echo Rename batch complete.
::pause
endlocal
If you put a shortcut to this in you SendTo
folder, you can select files in Windows Explorer, right-click, and pass them through the script to rename all in one go. With a little work you can get this to copy instead of rename (or both).