I am trying to pass multiple command line arguments to an application. The problem is that some of the arguments have spaces in them. I seem to be only able to send it as one argument, or seporated on the spaces.

So here is a simplified version of what I am doing.
VB Code:
  1. Dim CmdArgs() As String = {"C:\Program Files\Application\Recordings\", "Agr2", "Arg3"}
  2.  
  3. Dim arg As String = ""
  4.  
  5. For c As Integer = 0 to CmdArgs.Length - 1
  6.    arg &= """" & CmdArgs(c) & """" & " "
  7. Next
  8.  
  9. arg = arg.Trim
  10.  
  11. Dim psi As New ProcessStartInfo
  12. psi.Arguments = arg
  13. psi.FileName = AppPathAndName
  14. psi.RedirectStandardOutput = True
  15. psi.UseShellExecute = False
  16.  
  17. Dim p As New Process
  18. p.StartInfo = psi
  19. p.Start()

The way the code is above the argument string looks like this
"C:\Program Files\Application\Recordings\" "Arg2" "Arg3"
This only passes 1 argument that looks like this:
C:\Program Files\Application\Recordings\" Arg2 Arg3

If I add quotes a quote to the begining and end of arg this is what it looks like
""C:\Program Files\Application\Recordings\" "Arg2" "Arg3""
This passes 4 arguments:
C:\Program
Files\Application\Recordings\"
Arg2
Arg3"

notice the " in red