How can I insert data directly from cmd into text1? I tried this but get wrong output just some numbers...
Dim com As String
Private Sub Command1_Click()
Dim sCommand As String
sCommand = "dir"
Text1.Text = Shell("cmd.exe /k" & sCommand)
End Sub
How can I insert data directly from cmd into text1? I tried this but get wrong output just some numbers...
Dim com As String
Private Sub Command1_Click()
Dim sCommand As String
sCommand = "dir"
Text1.Text = Shell("cmd.exe /k" & sCommand)
End Sub
Your code is very close. Check out this answer and it should point you in the right direction. Getting command line output in VBScript (without writing to files) Basically you need to get the Shell command in to an object i.e objShell and then use the .StdOut.ReadLine() method.