VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. 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
    Quote Quote  
  2. I think this will work:

    Code:
    for %%x in (*.mkv) do mkvpropedit "%%x" --edit info --set "title=%%~nx"
    pause
    Quote Quote  
  3. 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
    Quote Quote  
  4. 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:

    Code:
    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
    It uses dir/b/s to build a list of all the files, walks through that list, then deletes the list.
    Quote Quote  
  5. I went ahead and did it...

    Code:
    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
    Quote Quote  
  6. Originally Posted by jagabo View Post
    I went ahead and did it...

    Code:
    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


    Brilliant. That's spot on. Thanks
    Quote Quote  
  7. Member
    Join Date
    Sep 2014
    Location
    Las Vegas, NV USA
    Search PM
    Originally Posted by mkr10001 View Post
    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
    Yes that was slick and here's the simple way to do the loop all the way through, much easier than creating a list file with delimiters.

    for /R <DIR> %%x in (*.mkv) do mkvpropedit "%%x" --edit info --set "title=%%~nx"
    pause

    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"
    Quote Quote  
  8. Member
    Join Date
    Sep 2012
    Location
    Australia
    Search Comp PM
    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).
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!