How can I execute an external script in Delphi (like wsh, vbs, bat...) and get back the result? I want to launch them as task within a thread do other things and when the result is ready the scripts itself will inform the application which will receive it in main thread. How to achieve that?
Use Microsoft's Windows Script COM interfaces, in particular the IActiveScript
interface.
You mention a lot of different script languages and engines in your question. They have all different possibilities. If you are free to choose your script language i would suggest two approaches:
Have a look at http://www.scalabium.com/smscript.htm they have a nice component to execute a script (VBScript, JavaScipt) and get the return value.
Have a look at http://www.remobjects.com/ps.aspx RemObjects Pascal Script, this is a very powerfull script language and there are plenty of examples around.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With