1

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?

1
  • 1
    Does it have to be a script? If there's an installed .net assembly, you could safely assume the framework is installed and provide a small console app. Commented Dec 21, 2009 at 16:45

2 Answers 2

3

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.

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

Comments

1

I've never tried it, but I would think your best bet would be to call the .Net component via COM interop. This article should get you started.

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.