I'm trying to batch rename a bunch of files to a portion of their parent folder but I can't seem to extract the part i want from the folder name. Here is what I have:
@echo off
for /d /r %CD% %%d in (*) do (
for /f %%b in ("%%~nxd") do (
set FULLNAME=%%b
set FILENAME=%FULLNAME:~9,-7%
for %%f in ("%%~d\??.json") do ren "%%~f" "%FILENAME%_%%~nxf"
)
)
pause
Again, I'm very inexperienced witch batch and I'm probably missing something obvious.