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.
 
Back
Top