I need a script which rename all files in all sub folders of script's root. I did search and found something which works and I can modify (I am a little bit newbie/laic)
@echo off
chcp 65001
setlocal enabledelayedexpansion
set filename=image
set /a x=1
>@rename.txt (
for /r %CD% %%f in (*.jpg) do (
echo rename "%%f" "!filename!_!x!.jpg"
rename "%%f" "!filename!_!x!.jpg"
set /a x+=1
)
)
endlocal
pause
But I want this to rename files to random string.
I found a lots of scripts which can generate random strings, but I just can't make them to work inside the FOR brackets.
for now im stuck with
@echo off
chcp 65001
setlocal enabledelayedexpansion
set /a x=%RANDOM%/99
>@rename.txt (
for /r %CD% %%f in (*.jpg) do (
echo "%%f" renamed to "!x!.jpg"
rename "%%f" "!x!.jpg"
set /a x+=%RANDOM%/99
)
)
endlocal
Which works fine, but has his limitations.
Any help will be appreciated