I found this script on here and modified it. It works only for 1 file at a time not multiple files. How can I get this script to rename multiple files in the directory specified?
@echo off
setlocal enabledelayedexpansion
set X=64
set Y=4
set FOLDER_PATH=c:\temp\renamefiles\files
pushd %FOLDER_PATH%
for %%f in (*) do if %%f neq %~nx0 (
set "filename=%%~nf"
set "filename=!filename:~%X%,-%Y%!"
ren "%%f" "!filename!%%~xf"
)
popd
I don't really know what you mean, but this is working for me:
If you execute this command, every file, no matter if there are .txt, .png, .foo, .bar,.. files.
Every file in that folder will get renamed to "foo". But if there are for example four .png files, there will be only one .png file falled foo.png, because the others can't rename when there is other files with the exactly same name already there.