Can I get the results of a Shell command launched in VBA

Brass Contributor

Hello,

I have a command line constructed in VBA which I send to the Shell command.

The command outputs its results to StdOut.

Is there anyway of accessing this StdOut results as a string back in my VBA after the Shell command completes?

 

I know I could construct the command line to redirect the results to a file and read the file but I was hoping that there was a smarter way of getting the results.

 

I am doing this in Excel 2010 on Windows 10.

 

Thank You

5 Replies
What is your shell command trying to achieve exactly?
Hello,
Thank you for taking the time to answer.
I have a list of media files in Excel. I want to pass these (one at a time) to a CLI version of a tool called MediaInfo. This tool outputs various details about the media in a single comma separated string. I want to parse this string to extract the details I want and to populate various cells next to the file list.
I will try this but I suspect it will only return standard file properties.
Details I'm after probably won't be there such as multiple sub-titles in a single file can each contain a Title, differing formats, language settings, etc. Other tracks in the file can also have differing codecs etc. All of which the MediaInfo tool will return for me.
Perhaps I will be wrong and it will work :)
OK I have tried this but it doesn't return the type of information I am after.