5

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?

1
  • How do you want to receive the response from the script? Do you want to get hold of stdout? Commented Jun 20, 2011 at 13:30

4 Answers 4

7

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

Sign up to request clarification or add additional context in comments.

2 Comments

Apparently the link to Scalabium.com provides a reasonable Delphi componentized wrapper to these interfaces.
the link provided has gone dead... more MSDN shenanigans! (:-D) The new link is msdn.microsoft.com/en-us/library/fdee6589(v=vs.94).aspx
3

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.

2 Comments

+1 for your first link there, appears to be what the OP wants.
I am not sure if I can run such script: computerperformance.co.uk/vbscrip /wmi_disks.htm#Example_1__VBScript_to_Display_Logical_Disk_Information
3

I suggest Delphi Web Script (DWS). This is excellent and aggressively updated by Eric - see his blog.

3 Comments

Does this execute wsh, vbs, bat etc.?
No, DWS only executes its own dialect of Delphi/Pascal.
So it doesn't really sound like it's what the OP is looking for.
1

Fast Report have Fast Script used in their famous reporting Fast Report

TMS software also have TMS Scriptor studio and TMS Scriptor studio pro

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.