Following the solution at Windows batch assign output of a program to a variable, I am using the following code:
FOR /F %%I IN ('"ffprobe -v error -select_streams a:0 -show_entries stream=channels -print_format csv=p=0 %1"') DO ECHO %%I
This breaks for arguments containing parentheses (e.g. a file name). For example, a file titled "Test File (2017.22.02) [1].aac" causes the following error: [1].aac""') was unexpected at this time.
Any ideas on how to fix this?