Вопрос

I have a few things like running SFC, defrag, and reset the page file and so on, things that can be done within windows VBScript, I am just wondering if I can compile that code as a resource and call it as needed. Thanks.

Lee

Это было полезно?

Решение

You can use the Windows Script Host interfaces, IActiveScript and IActiveScriptParse, to execute Javascript/VBScript from memory. You can then compile your Javascript/VBScript into a resource, extract it at runtime, and then execute it when needed.

Update: have a look at this blog article:

Adding Active Scripting to your Delphi Win32 application

And then look at this discussion to make it work in 64bit:

Writing a scripting host in Delphi XE2 64-bit

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top