I'm trying to run a file called mkisofs.exe via command prompt like so:
Code:Private Sub CMDAutomate() Dim myProcess As New Process Dim StartInfo As New System.Diagnostics.ProcessStartInfo StartInfo.FileName = "cmd" StartInfo.RedirectStandardInput = True StartInfo.RedirectStandardOutput = True StartInfo.UseShellExecute = False StartInfo.CreateNoWindow = True myProcess.StartInfo = StartInfo myProcess.Start() Dim SR As System.IO.StreamReader = myProcess.StandardOutput Dim SW As System.IO.StreamWriter = myProcess.StandardInput SW.WriteLine(Convert.ToChar(34) & "C:\record\mkisofs.exe" & Convert.ToChar(34) & " -J -joliet-long -jcharset " & Convert.ToChar(34) & "iso8859-1" & Convert.ToChar(34) & " -l -r -V " & Convert.ToChar(34) & txtLabel.Text & Convert.ToChar(34) & " -o " & Convert.ToChar(34) & "C:\TEST.iso" & Convert.ToChar(34) & " " & Convert.ToChar(34) & "D:\" & Convert.ToChar(34)) SW.WriteLine("exit") Results = SR.ReadToEnd MsgBox(Results) SW.Close() SR.Close() End Sub
mkisofs.exe takes a long time to complete it's task, but for some reason that code exits out seconds after starting. I've tested the command to run mkisofs and it works, so it's gotta be something with code.
My second question is how to constantly get updates from the command prompt, eg: Run mkisofs.exe via command prompt, get every new line (MKISOFS.exe creates a new line saying:
10%
20%
30% complete, blah blah blah
So I can update my app's progress bar.




Reply With Quote