Below are my current codes that will run a .VBS file.
When I run the code it will open an CMD app to show the process.
Now how can I run the .VBS file and the process will be shown in Textbox/Richtextbox.
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim t As String = Cmb1.SelectedItem
If Cmb1.SelectedItem = "" Or Cmb2.SelectedItem = "" Then
MsgBox("Error", MsgBoxStyle.Critical, Me.Text)
Else
Try
Dim proc As Process = Nothing
Dim batDir As String = String.Format("C:\")
proc = New Process()
proc.StartInfo.WorkingDirectory = batDir
proc.StartInfo.FileName = t.Trim + ".vbs"
proc.StartInfo.CreateNoWindow = False
proc.Start()
proc.WaitForExit()
Catch ex As Exception
Console.WriteLine(ex.StackTrace.ToString())
End Try
End If
End Sub