ASP.Net run VBS function

  • Thread starter Thread starter Nigel
  • Start date Start date
N

Nigel

Hi All,

Does anyone know if it is possible / know how to run a function in a vbs
script from a c# asp.net 2.0 page passing a variable to it and getting a
value back?

Thanks in advance.

Regards,

Nigel
 
System.Diagnostics.Process p = System.Diagnostics.Process.Start(@"Test.vbs",
"command line args");
p.WaitForExit();
Console.WriteLine (p.ExitCode.ToString());

Your VBScript file would use WScript.Arguments to access the command line
args passed from .NET and quit as WScript.Quit (return code). The return code
is fetched via the ExitCode propert as above.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top