@echo off

REM This file identifies the existence or type of audio in a media file

set ffmpegpath=d:\programs\ffmpeg\bin
REM if needed
rem set path=%PATH%;%ffmpegpath%;
Rem tmp.txt will contain noAudio or the audio type - eg AC3 etc for each call
Rem DO NOT PUT QUOTES AROUND %1 in ffmpeg call when using MediaSort.bat
rem set greppath=c:\

   call %ffmpegpath%\ffprobe  -loglevel -8 -select_streams a:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey=1 %1  > tmp.txt
        call sizetest.bat tmp.txt
        if %errorlevel% EQU 0   (  @echo %1# NOAUDIO >> noAudio.lst
        ) else (
          for /F %%C in ( tmp.txt )  do (
            @echo %1# %%C >> audio.lst
          )
        )