i’m trying to set up an application capable of running VBScript files from .NET (See here), and have most of it set up fine, but I want to test this out, so I need to be able to return data from my VBScripts. I’ve found that I can use WScript.Quit([ErrorCode]) to get back an integer value, but what about returning strings? Is it possible to feed them out to the DataReceivedEventHandler? Or do I need to look at a different method? Thanks.
Share
You can write to the standard output (which will redirect it to the event handler). I believe in VBScript this is WScript.Stdout.
If you have multiple lines written out you may consider using something like a StringWriter to capture them all, ie