I'm trying to make a C# program that can listen for and output to cmd.exe and log it to file. For example, if I run an exe and it runs a command in cmd like echo "hello"
, I want echo "hello"
to be written in a file.
I know I need to use FileSystem
, as well as Process
maybe?
If this is even possible, and help would really be appreciated. Thanks.