Shell Program

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How to write a shell program in visual basics to run a batch file.please help.
thanks in advance.
 
hey all,

what if i wanted to get a response back so i'll know when the .bat file has
completed normally? is there a way to handle that?

thanks,
rodchar
 
Rodchar,

You mean this one,

\\\
Dim p As New Process
dim pi as new processstartinfo
pi.UseShellExecute = False
pi.RedirectStandardOutput = True
pi.Arguments = myargumentstring
pi.WorkingDirectory = myworkdirectorystring
pi..FileName =C:\myprogram
pi.startinfo = pi
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
///

Cor
 
what are the following lines suppose to do:

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

will this let the application know when the p.start() is completed. how
would i check for it?
 
now, is this something i can use to tell me when the .bat file has completed.

will this cause the vb.net program to wait for the .bat file to finish
before proceeding?

what value or variable do i check to make sure the .bat program is finished
before proceeding?

thanks,
rodchar
 

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

Back
Top