Page 1 of 1

Extreme NewBie here

Posted: 15 Dec 2022 02:17
by Tizi1965
Howdy all,
not sure how to go about this, hope someone can guide me ( not spoon feed ).......
i have a drive full of movies, each movie has a parent folder and a subs folder.
example : c:\diehard\subs\english.srt
what i would like to learn and do is to copy contents from sub and rename with movie title.
then move srt file to parent dir once completed delete subs folder.

cheers 8) 8) 8)

Re: Extreme NewBie here

Posted: 18 Dec 2022 07:46
by Lucky4Me

Code: Select all

for /r %%f in (*.avi,*.mp4,*.mkv) do (
if exist "%%~dpfsubs\english.srt" copy "%%~dpfsubs\english.srt" "%%~dpf%%~nf.srt"
if exist "%%~dpf%%~nf.srt" rd /S /Q "%%~dpfsubs"
)
This should do the job for avi, mp4 and mkv files.

It searchs the subs folder for english.srt, then copy the file to the film folder with the same filename of the film and then removes the subs folder with everything in it.
Added a safty, so it wouldn't remove the subs folder if there's no srt next to the film.