Dim oProcess as new Process
oProcess.StartInfo.UseShellExecute = True
oProcess.StartInfo.FileName = "CScript c:\script.vbs //nologo"
If you have some VBScript that you want to intereact with variables or run on the fly. Microsoft has a ScriptControl that allows you to do just that. The script control has 3 options of running code.
- Eval: Evaluates a text expression.
- Run: Runs a named Sub or Function.
- Execute: Executes a script statement.
You can find more information on the ScriptControl at Microsoft.
Q184740: How To Call Functions Using the Script Control
Q184739: INFO: Where to Obtain the Script Control
If you are looking to run vb.net code inside vbscript, see my other post:
Running VB.NET code in VBScript or other apps