I need to rename the folders in path2 to the folders in path1 if they have a specific file in common. They are duplicates but folders name in path2 follows the pattern [ARTIST] TITLE, and I need it to get back to it's original name.
I tried this but it doesn't change directory within the for loop, and at this point I know it doesn't make sense to even continue...
for /R %%f in (*.bms;*.bme;*.bml;*.pms;*.bmson) do (
set Hash1 = CertUtil.exe %%f
set Dir1 = %cd%
cd C:\path2\
for /R %%f in (*.bms;*.bme;*.bml;*.pms;*.bmson) do (
setlocal Hash2 = CertUtil.exe %%f
setlocal Dir2 = %cd%
if Hash1 equ Hash2 (
ren %Dir2% %Dir1%
)
)
cd C:\path1\
)