We have a legacy system that allow customer to custmize the workflow by vbscript, for example, the user could write some code like
for each account in accounts {
Dim acc as Integer
.....
}
the code inside the {...} is VBScript. and the legacy system is writtern by VB, and use ScriptControl to execute the script directly. Now we are going to upgrade the system to C# .NET 4.5, we want to get rid of the old scriptcontrol but want to keep the scripts from users.
My question is it possible to execute vb script from C#?
Thanks
You can execute VBScript from C# code.
Process scriptProc = new Process();
scriptProc.StartInfo.FileName = @"C:\text.vbs";
scriptProc.Start();
scriptProc.WaitForExit();
scriptProc.Close();
There are some important things that you have to consider. Take a look at this answer
finally, we decide to migrate to IronPython instead of VBS, vbs is not supported by microsoft. so it's time for move on
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With