كود :
Imports System.IO
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If TextBox1.Text = "" Then Exit Sub
Dim TmpFile As String = "D:\Temp.Txt"
If Dir(TmpFile) <> "" Then Kill(TmpFile)
If TextBox1.Text = "clr" Then
TextBox2.Text = ""
TextBox1.Text = ""
Exit Sub
End If
Shell("cmd.exe /c " & TextBox1.Text & " > " & TmpFile, AppWinStyle.Hide, True)
Dim OpenResult As New StreamReader(TmpFile)
TextBox2.Text = OpenResult.ReadToEnd
OpenResult.Close()
Application.DoEvents()
TextBox1.Text = ""
End Sub
End Class