VideoHelp Forum




+ Reply to Thread
Results 1 to 6 of 6
  1. I have folder structure like this

    Code:
    C:\TV\1\file.mp4
    C:\TV\2\file.mp4
    C:\TV\3\file.mp4
    i want to mux mp4 to mkv and remove the mp4 file after that. i got a sample batch script but it require to place it inside the folder where the file is located.

    Code:
    FOR %%A IN (*.mp4) DO "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~nA.mkv" "%%~A"
    i am not sure how can i add command by which batch script will read all the subfolder files. any help please?
    Quote Quote  
  2. Code:
    FOR /R %%A IN (*.mp4) DO "C:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~dpnA.mkv" "%%~dpnxA"
    Quote Quote  
  3. Member netmask56's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Search Comp PM
    I would like to do the same but NOT remove the mp4 file?
    SONY 75" Full array 200Hz LED TV, Yamaha A1070 amp, Zidoo UHD3000, BeyonWiz PVR V2 (Enigma2 clone), Chromecast, Windows 11 Professional, QNAP NAS TS851
    Quote Quote  
  4. Neither of the above batch files deletes the source video. If you wanted to delete the source videos you would have add a second command:

    Code:
    FOR /R %%A IN (*.mp4) DO (
        "G:\Program Files\MKVToolNix\mkvmerge.exe" -o "%%~dpnA.mkv" "%%~dpnxA"
        del "%%~dpnxA"
        )
    iKron didn't ask about that so I assumed he already know that part.
    Quote Quote  
  5. Member
    Join Date
    Aug 2025
    Location
    Cincinnati OH USA
    Search Comp PM
    over 3 years later.......thank you so much for this. We have a relatively new Amazon Fire TV that doesn't like mp4s, but has no issue with mkvs. I had been searching for a tool to batch-convert and had not found quite the right thing - each file i have in it's own folder, and the last script i tried generated the MKVs into the root folder instead of the source folder. This script is doing exactly what i need it to, so thank you!
    Quote Quote  



Similar Threads

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