How to start an VBScript and control the process?

  • Thread starter Thread starter DraguVaso
  • Start date Start date
D

DraguVaso

Hi,

I have a VB.NET application that has to start some VBScripts, but I need to
be able to 'control' these started proecesses.

At least I should know when the VBScript has finished, but if I would be
able to get other information back this would be helpfull too.

Anybody knows how to do this?

Thanks in advance,

Pieter
 
Thanks, but it's not that I am looking for. What I need is like a
ShellExecute, but I need to know when the execution is finsihed etc. I don't
want the code to be put in my applciation, but as a different script.


Chris Podmore said:
Pieter,

Do a quick search in this newsgroup for "convert string to object". In one
of the replies I have posted some sample code.
 
Hi Pieter,

I am busy with this but it is still not ready, however try it, I think that
you can do the rest yourself.

It is not the original code so watch what I did remove.

I hope this helps,

Cor

Dim p As New Process
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = True
p.StartInfo.WorkingDirectory = "C:\
p.StartInfo.FileName = "C:\test.vbs
p.Start()
Dim sr As IO.StreamReader = p.StandardOutput
Dim sb As New System.Text.StringBuilder("")
Dim input As Integer = sr.Read
Do Until input = -1
sb.Append(ChrW(input))
input = sr.Read
Loop
Me.TextBox1.Text = sb.ToString
 
Back
Top