I've got a script to change the title of the mkv to that of the file name but it's adding the extension as well. Does anyone know how I can make it ignore the extension
This is what I'm using at the moment
Code:for %%x in (*.mkv) do mkvpropedit "%%x" --edit info --set "title=%%x" pause
+ Reply to Thread
Results 1 to 8 of 8
I think this will work:
for %%x in (*.mkv) do mkvpropedit "%%x" --edit info --set "title=%%~nx" pause
That's spot on thanks
do you know how I can make it work by putting it in folder and have it go through all the folders and do all the mkvs? I've never liked trying to do loops with bat files
Here's batch file I have that converts all m4a files in all folders/subfolders (from where the batch file is located). You should be able to adapt it for your purposes:
dir/b/s *.m4a >m4alist.txt for /F "delims=;" %%F in (m4alist.txt) do "g:\program files\ffmpeg\bin\ffmpeg.exe" -i "%%F" -f wav -ac 2 "%%~dF%%~pF%%~nF.wav" del m4alist.txt
I went ahead and did it...
dir/b/s *.mkv >list.txt for /F "delims=;" %%F in (list.txt) do "G:\Program Files\mkvtoolnix\mkvpropedit" "%%F" --edit info --set "title=%%~nF" del list.txt
for /R <DIR> %%x in (*.mkv) do mkvpropedit "%%x" --edit info --set "title=%%~nx"
That will auto loop through the <DIR> tree, obviously if you are doing it interactive you only need 1 % in each place and no pause:
for /R <DIR> %x in (*.mkv) do mkvpropedit "%x" --edit info --set "title=%~nx"
I'm wondering if I should post mine. It's a bit big and sets all the track names too, plus it requires a silly little program I wrote that taps into the mediainfo dll. I tend to set TV episodes numbering as - SSxEE - but it shouldn't be hard to modify the batch. The problem with setting the Segment Title to the file name is that there are a few characters the file system doesn't allow so of course they're removed from the name. As a final step I generally run a powershell script that finds all the relevant info in the MediaCenterMaster data files and happily sets the Segment title with the full character set (and sets some basic tags as well, at least the ones I think are safe).