Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate scripts into delphi

Tags:

delphi

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?

like image 766
marcostT Avatar asked Jun 20 '11 07:06

marcostT


2 Answers

Use Microsoft's Windows Script COM interfaces, in particular the IActiveScript interface.

like image 78
Remy Lebeau Avatar answered Oct 04 '22 22:10

Remy Lebeau


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:

  1. 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.

  2. 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.

like image 40
Andreas Avatar answered Oct 04 '22 20:10

Andreas