I want to write a script that can run on a vanilla Windows (XP or later) system and call methods in an installed (GAC'd) .NET assembly. (I need to deliver the script to other people and I don't want to assume that they have anything in particular installed (other than the the assembly in question). Can I use JavaScript (JScript) or VBScript (in conjunction with the standard Windows cscript/wscript commands) to do this somehow?
+2
A:
If the class whose methods you wish to call is exposed to COM, you should be able to do something like this (VBScript):
Dim o
Set o = CreateObject("MyAssembly.MyObject")
o.MyMethod()
ScottS' answer has a good link.
Justin Swartsel
2009-12-21 16:40:11
The correct syntax is `Set o = CreateObject(...)`.
Helen
2009-12-21 16:54:18