• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

ASP.NET C# Run VBS file

Is it possible / does anyone know how in a ASP.NET C# 2.0 page to run a vbs file passing it a value and getting a string back from it?

Regards,

Nigel
0
Nigel_Taylor
Asked:
Nigel_Taylor
  • 2
1 Solution
 
RobSampsonCommented:
Hi,

I am by NO means a C# programmer (never touched it actually), but, in other languages, you would use a Shell command to execute an external program, so you could try something like this:
'============
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents=false;
proc.StartInfo.FileName="cscript.exe c:\\dotnetstuff\\scrip1.vbs";
proc.Start();
'============

As for retrieving a string back from it, I think you could only do this if you know how to read STDOUT, which cscript will give you, provided that somewhere in the VBScript is a WScript.Echo statement.

Regards,

Rob.
0
 
RobSampsonCommented:
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now