I'm sure this is one of these post where it will take someone 1 sec to point me to the correct solution, and I apologize in advance.
I have done this using other exe but I can't seem to get an argument passed to a CMD window.
Here is my code:
The dir command is not passed to the windows once it opens.
What am I doing wrong please? :confused:
Thank you.
I have done this using other exe but I can't seem to get an argument passed to a CMD window.
Here is my code:
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim DOSWindow As New Process
DOSWindow.StartInfo.FileName = "cmd"
DOSWindow.StartInfo.Arguments = "dir"
DOSWindow.Start()
DOSWindow.WaitForExit(10000)
DOSWindow.Close()
End Sub
End Class
What am I doing wrong please? :confused:
Thank you.