3
1
I have hundreds of folders named after movies. In each folder there's a .mkv
file (or .avi
, .mp4
), named differently. In each folder there's a folder.jpg
.
I'd like to rename each video file so that it carries the name of its parent folder. folder.jpg
must stay unchanged though.
For example, the folder structure is like this:
- Movies/Stirb Langsam 1/stlg1.mkv
- Movies/Stirb Langsam 2/stlg2.mkv
- Movies/Star Wars 1/hhgdtebds.mkv
- Movies/Star Wars 2/stwa2.mkv
And should be:
- Movies/Stirb Langsam 1/Stirb Langsam 1.mkv
- Movies/Stirb Langsam 2/Stirb Langsam 2.mkv
- Movies/Star Wars 1/Star Wars 1.mkv
- Movies/Star Wars 2/Star Wars 2.mkv
At the moment I use Windows 7 for that. Would be nice if one of the scripting gurus could help me.
By the way, my script was based on answers to these questions: http://stackoverflow.com/questions/2043869/how-to-execute-a-windows-batch-command-recursively and http://stackoverflow.com/questions/3432851/dos-bat-file-equivalent-to-unix-basename-command
– Gnubie – 2012-10-05T17:15:50.483Thank you, the script worked for files without a blank and without dot in the name. I found a tool, that helped me out for the rest. <<advanced renamer>> – Andreas – 2012-10-09T09:19:25.287