Quantcast
Viewing all articles
Browse latest Browse all 27080

VS 2010 Problem with passing argument to cmd

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:
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

The dir command is not passed to the windows once it opens.
What am I doing wrong please? :confused:

Thank you.

Viewing all articles
Browse latest Browse all 27080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>