I had 5219 files across hundreds of sub directories that I needed to rename to remove the language tag, and came up with the below.
I can guarantee you that there is a faster and more efficient way out there, but at 11pm on a Friday night when I was tired and in a hurry.. this worked:
First, open command prompt and navigate to the parent folder that your shed-load of .eng.srt files exist (e.g. N:\TV Shows\), and run this:
Code: Select all
dir /b /s *.eng.srt > file_list.txt
(If using a UCN path, you'll need to map it as a network drive temporarily, browse via the mapped drive, and then open the txt and do a 'replace all' to swap out the network drive with the full UNC path - unless your FileBot likes network drives, which mine doesn't lol.. YMMV)
Next, you'll need to do a 'replace all' to make sure that each line starts and ends with a double quote character " like this:
"N:\TV Shows\Show Name\Season 01\Show Name S01E01 Stuff [480p DivX MP3 2ch].eng.srt"
"N:\TV Shows\Show Name\Season 01\Show Name S01E02 Stuff [480p DivX MP3 2ch].eng.srt"
"N:\TV Shows\Show Name\Season 01\Show Name S01E03 Stuff [480p DivX MP3 2ch].eng.srt"
Then, move file_list.txt to a path without spaces (in this example, N:\)
The next assumes you have created remove-language-tag.cmd from rednoah's GitHub link above (also assumes you saved it in C:\Program Files\FileBot\cmdlets\)
Finally, run this from the command line:
Code: Select all
for /F "delims==" %1 in (N:\file_list.txt) do call "C:\Program Files\FileBot\cmdlets\remove-language-tag.cmd" %1
Now.. you'd think that putting quotes around the name of the file like ("N:\file_list.txt") would allow a path without spaces, but no... You'd think that maybe putting double quotes or double double (escape) quotes around the %1 might negate the need to put each line of the text file between quotes, but no...
There's probably an easy enough way around those limitations, but the above worked, and after I got it sorted, I didn't really want to spend any more time looking at the issue, lol