How to Execute Command Line Argument in Vb.Net (100% Sure Shot Work)
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
 Sub Main()
        System.Console.WriteLine(GETCMD("dir"))
        System.Console.ReadLine()
    End Sub
    Private Function GETCMD(ByVal Command As String) As String
        Dim CMDprocess As New System.Diagnostics.Process
        Dim StartInfo As New System.Diagnostics.ProcessStartInfo 
        StartInfo.FileName = "cmd"
        StartInfo.RedirectStandardInput = True
        StartInfo.RedirectStandardOutput = True
        StartInfo.UseShellExecute = False 
        CMDprocess.StartInfo = StartInfo
        CMDprocess.Start() 
        Dim SR As System.IO.StreamReader = CMDprocess.StandardOutput
        Dim SW As System.IO.StreamWriter = CMDprocess.StandardInput 
        SW.WriteLine(Command)
        SW.WriteLine("exit") 
        Dim Str As String = SR.ReadToEnd
        SW.Close()
        SR.Close()
        Return Str
    End Function