I'm trying to recurse through a directory tree, and when I find a certain file I want to rename it to "name of directory"+".nfo"
So...let's say I find tvshow.nfo like this:
Y:\Video\Misc Series\The Simpsons\tvshow.nfo
(I don't know how deep the tree might be, so it may be fewer or more subdirectories)
What I want to do is to rename "tvshow.nfo" -> "The Simpsons.nfo".
Anyone know how to extract only the last part of the directory? My though is something along the lines of %~pI and then split by "/" or "\", and then only using the last one...?...
Any help would be greatly appreciated!