0

How do I call a function inside a VBScript file from C#? The function has 2 parameters.

0

1 Answer 1

2

There are a few ways you can do this. The simplest would be to execute the VBScript file from a command line inside C#. You would need to pass your parameters in at the command line, but the code would look similar to this:

System.Diagnostics.Process.Start(@"cscript //B //Nologo c:\yourfile.vbs");

Here are more examples of how to execute command line functions in C#:

http://www.dotnetperls.com/process-start

You can also get more advanced with these methods:

http://msdn.microsoft.com/en-gb/magazine/cc301954.aspx

http://msdn.microsoft.com/en-us/library/ms974577.aspx

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

1 Comment

+1 for dotnetpearls.com ... great site with some good tutorials and a respectable source for info.

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.