C# Interfaces for the Windows Scripting Host
Introducing a C# implementation of the interfaces required to implement a Windows Scripting Host

Introduction
For the upcoming version 8 of our Windows based CMS Zeta Producer, I included the Windows Scripting Host for VBScript files into the application. Therefore I was in the need to get all the interfaces required to implement my own host.
Since it was rather hard and time-consuming to put all these interfaces together, I wrote this article to make it easier for others requiring the same information.
Therefore this article simply lists the interfaces but does not show any implementations of them. (Of course, please still do vote with a high rating for the article).
Defined Types
The following interfaces are defined:
IActiveScript
(MSDN documentation)IActiveScriptError
(MSDN documentation)IActiveScriptParse
(MSDN documentation)IActiveScriptSite
(MSDN documentation)
The following enums are defined:
SCRIPTSTATE
(MSDN documentation)SCRIPTINFOFLAGS
(MSDN documentation)SCRIPTITEMFLAGS
(MSDN documentation)SCRIPTTHREADSTATE
(MSDN documentation)
Using the Code
As mentioned above, this article is a reference for Windows Script interfaces, not an article about how to actually write your own Windows Scripting host.
For more information about this topic, please refer to Google or one of the following websites:
- ".NET Scripting Hosts" - Multi part article from the DDJ about working with Windows Scripting under .NET
- Eric Lippert's Weblog - Various good references
- Google group "microsoft.public.scripting.hosting" - Also various resources and references
- "SAMPLE: MFCAxs.exe Implements an Active Script Host Using MFC" - Microsoft Knowledge Base article about implementing your own scripting host
- Mark Baker's "Windows Scripting FAQ" (on Archive.org) - Very good collection of dealing with Windows Scripting Host
Conclusion
In this article, I've shown you the C# implementation of the interfaces to the Windows Scripting Host engine.
I would be happy to get your feedback in the comments section at the end of this article. Feel free to ask your questions or provide me with suggestions and enhancements.
History
- 2007-05-18: Initial release of the article