Hi all,
I am planning to make an IDE for autoit in vb.net. Now i am practicing how to run my scripts from my new IDE. I have successully ran some one or two line scripts. But i can't run scripts using any kind of loops. This is my vb.net code;
Private Sub BTN_Run_Click(sender As Object, e As EventArgs) Handles BTN_Run.Click
Dim AutoitCmd As String = "C:\Program Files\AutoIt3\Autoit3.exe "
Dim path As String = Application.StartupPath
Dim tempName As String = "\Untitled.au3"
Dim Filename As String = path & tempName
Dim procID As Integer
Dim Proc As New Process
Proc.StartInfo.FileName = AutoitCmd
Proc.StartInfo.Arguments = """" & Filename & """"
Proc.StartInfo.CreateNoWindow = True
Proc.StartInfo.UseShellExecute = False
Proc.StartInfo.RedirectStandardOutput = True
Proc.Start()
procID = Proc.Id
Dim outrd As StreamReader = Proc.StandardOutput
Dim out As String = outrd.ReadToEnd
cc1.WriteOutput("==> " & out, Color.GreenYellow)
If Proc.HasExited = True Then
Proc.Close()
Else
Proc.WaitForExit()
cc1.WriteOutput("==> Running" & Filename, Color.GreenYellow)
End If
End Sub