This command in cmd renames all files in the current directory
for /f "tokens=*" %a in ('dir /b') do ren "%a" "00_%a"
But I need to get the current subdirectory name (folder name only) and append that to the %a
It should loop through all the subdirectories in the parent
folder.
I have Path C:\Temp\Photos_ToRename
with following folders and files
NVA-1234 (this is a subdirectory name)
--- IMG_0999.jpg (rename to NVA-1234_IMG_0999.jpg)
--- IMG_0989.jpg (rename to NVA-1234_IMG_0989.jpg)
--- IMG_0979.jpg (rename to NVA-1234_IMG_0979.jpg)
NVS-3456 (this is a subdirectory name)
--- IMG_1999.jpg (rename to NVS-3456_IMG_1999.jpg)
--- IMG_1989.jpg (rename to NVS-3456_IMG_1989.jpg)
--- IMG_1979.jpg (rename to NVS-3456_IMG_1979.jpg)
NVS-3359 (this is a subdirectory name)
--- IMG_2999.jpg (rename to NVS-3359_IMG_2999.jpg)
--- IMG_2989.jpg (rename to NVS-3359_IMG_2989.jpg)
--- IMG_2979.jpg (rename to NVS-3359_IMG_2979.jpg)
.....