I need to rename lots of files using command prompt, I want to use command promt please (casue I cant install third party software or python etc)
I tried to write some command prompt script, it seems to be working but just missing the finishing touch. the problem is that my script somehow rename all the files with the last folder name, not iterative
for /d %i in ("C:\Users\noir1\Desktop\New folder\*") do ( cd "%i" & set _test=%i & for %a in (*) do ren "%a" "%_test:~34,13% %a")
what I have: within "New folder" there are 4 more folders:
- "New folder 1xxxx" and within this folder I have "file1, "file2", "file3"
- "New folder 2xxxx" and within this folder I have "file1, "file2", "file3"
- "New folder 3xxxx" and within this folder I have "file1, "file2", "file3"
- "New folder 4xxxx" and within this folder I have "file1, "file2", "file3"
I want to see file1, file2, file 3 name within all the folders to change base on the parent folder:
- "New folder 1xxxx" and within this folder I have "New folder 1 file1", " New folder 1 file2", "New folder 1 file3"
- "New folder 2xxxx" and within this folder I have "New folder 2 file1", " New folder 2 file2", "New folder 2 file3" and so on
But instead if I use my cript above I got
- "New folder 1xxxx" and within this folder I have "New folder 4 file1", " New folder 4 file2", "New folder 4 file3"
- "New folder 2xxxx" and within this folder I have "New folder 4 file1", " New folder 4 file2", "New folder 4 file3"