Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim ruta As String
On Error Resume Next
ruta = "c:\hi.txt"
Kill ruta
Kill "c:\tio.bat"
Open "c:\tio.bat" For Binary As #1
Put #1, , "@echo off" & vbCrLf
Put #1, , Text1.Text & ">>C:\hi.txt" & vbCrLf
Put #1, , "exit"
Close #1
Shell "c:\tio.bat", vbHide
Sleep 1000
Open "C:\hi.txt" For Input As #1
Dim resultado As String
Do While Not EOF(1)
Line Input #1, resultado
If Not resultado = "" Then Text2.Text = Text2.Text & vbCrLf & resultado
Loop
Close #1
End Sub
Private Sub Command2_Click()
Text2.Text = ""
End Sub
Private Sub Form_Load()
Me.Caption = "Shell"
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
KeyAscii = 0
Call Command1_Click
End If
End Sub
Espero qeu te sriva,es bastante sencilla y creo qeu servirá para tu proposito.
Evidentemente no es una consola,peor los comandos se envian y se lee las respuestas.
Saludos.