Unanswered question

Custom Action - Command line - how to read the output?

I want to read the output of the command line to see check if the program executed successfully or get some information like System Variable information like %appdata%.

I can use the command as "echo %appdata%" and it would print the value in the output. How can I read this output and use it in the script. Please share an example if possible.