Run vbs from C#

M

MAF

I need to find a way to run a vbs on the same thread that I am currently on.

Here is the code I have now and this causes the scripts to be run out of
order. I want to have the application wait until the process is finished
before executing the next script.
Process scriptConsoleProcess;


scriptConsoleProcess = new Process();

scriptConsoleProcess.StartInfo.FileName = scriptPath;

scriptConsoleProcess.StartInfo.UseShellExecute = true;

scriptConsoleProcess.StartInfo.CreateNoWindow = true;

scriptConsoleProcess.Start();
 
B

Bob Grommes

After you start the process:

while (scriptConsoleProcess.HasExited == false) {
// do nothing ... or maybe exit if too much
// time has passed.
}
 

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

Top