VideoHelp Forum
+ Reply to Thread
Results 1 to 5 of 5
Thread
  1. Hello there,

    I few weeks ago I came here to ask for help. I wanted to run MediaInfo CLI from the sendTo contextual menu. From the send to menu is easy, just place the batch script in there.
    But I wanted to have the nfo created be the default one, but just with the file name and not the path in the general part of the nfo.
    I got 4 versions of it, 2 for a single file (without the path in the file name and with only the folder containing the file) and 2 for all the files in the folder (only name and only parent folder and name too):
    This code here is to create nfo's for all files in the folder (without the path in the name in the general part of the nfo)
    Code:
    @echo off
    for /r %%a in ("*.mp4", "*.avi", "*.mkv") do call :process "%%a"
    Exit
    
    :process
    %~d1
    cd "%~p1"
    "C:\Program Files\MediaInfo_CLI_21.09_Windows_x64\MediaInfo.exe" --LogFile="%~dpn1.nfo" "%~nx1"
    goto :eof
    How could I make it so that instead of making an NFO for every single file, to make a single nfo for all of the files.
    As i'm writing this, I'm thinking a solution would be to run something at the end of the script that takes all nfos and groups them ?

    Any ideas how I could achieve that?

    Thanks for your help
    Quote Quote  
  2. use >> to append the output of each mediainfocli call to the same file.

    Code:
    @echo off
    for /r %%a in ("*.mp4", "*.avi", "*.mkv") do call :process "%%a"
    Exit
    
    :process
    %~d1
    cd "%~p1"
    "C:\Program Files\MediaInfo_CLI_21.09_Windows_x64\MediaInfo.exe" "%~nx1" >>MediaInfoAll.txt
    goto :eof
    Quote Quote  
  3. Originally Posted by jagabo View Post
    use >> to append the output of each mediainfocli call to the same file.

    Code:
    @echo off
    for /r %%a in ("*.mp4", "*.avi", "*.mkv") do call :process "%%a"
    Exit
    
    :process
    %~d1
    cd "%~p1"
    "C:\Program Files\MediaInfo_CLI_21.09_Windows_x64\MediaInfo.exe" "%~nx1" >>MediaInfoAll.txt
    goto :eof
    Thank you
    Quote Quote  
  4. You may want to delete MediaInfoAll.txt before starting the for loop -- in case there's one there already.
    Quote Quote  
  5. Originally Posted by jagabo View Post
    You may want to delete MediaInfoAll.txt before starting the for loop -- in case there's one there already.
    Yeah that'd be better, but it's fine as it is since I'll rename the file after, but thx anyways
    Quote Quote  



Similar Threads

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