title: Cannot open Jar file, with right arguments VB
body: <p>I'm working on a game launcher (Yes there is already one, but mine will be different).
  The problem is, if you log in, the game tries to launch, but I get a console window displaying "cannot access jarfile c:\users\max korlaar\dropbox\max " and it closes after 1 milisecond.
  I don't know why, because the given jar files in my Process Arguments are there, and I think VB.net does something with the location. The jar files are located in a folder Bin, relative to my program. (And Yes, I tried replacing + with &amp;)</p>
  
  <pre><code>Dim process As New Process
  Dim info As New ProcessStartInfo
  info.FileName = GetJavaHome() + "\java.exe"
  info.CreateNoWindow = True
  info.UseShellExecute = True
  info.RedirectStandardError = False
  info.RedirectStandardOutput = False
  Dim args As String = "-jar  -natives{1} -lwjgl{2} -mlcfg{3} -mlmod{4} -j{5} -u{6} -s{7}"
  info.Arguments = String.Format(args, My.Application.Info.DirectoryPath + "\bin\natives", My.Application.Info.DirectoryPath + "\bin\natives", My.Application.Info.DirectoryPath + "\bin\lwjgl.jar", My.Application.Info.DirectoryPath + "\config\", My.Application.Info.DirectoryPath + "\mods\", My.Application.Info.DirectoryPath + "\bin\minecraft.jar\", TextBox1.Text, result)
  info.Arguments = info.Arguments.Replace("\bin\minecraft.jar", My.Application.Info.DirectoryPath + "\bin\minecraft.jar")
  process.StartInfo = info
  process.Start()
  </code></pre>
  
  <p>After trying some suggestions I modified it a little, and got this:</p>
  
  <pre><code>    Dim process As New Process
      Dim info As New ProcessStartInfo
      info.FileName = GetJavaHome() + "\java.exe"
      info.CreateNoWindow = False
      info.UseShellExecute = False
      info.RedirectStandardError = False
      info.RedirectStandardOutput = True
  
      'Got error: Corrupt jar file... Someone with Minecraft Experience can help me to launch it?
      Dim args As String = "-jar ""{6}"" -natives ""{1}"" -lwjgl ""{2}"" -mlcfg ""{3}"" -mlmod ""{4}"" -j ""{5}"" -u ""{6}"" -s ""{7}"""
      ' Got CMD window popping up with error and disappearing
      info.Arguments = String.Format(args, "none", My.Application.Info.DirectoryPath &amp; "\bin\natives\", My.Application.Info.DirectoryPath &amp; "\bin\natives", My.Application.Info.DirectoryPath &amp; "\bin\lwjgl.jar", My.Application.Info.DirectoryPath &amp; "\config\", My.Application.Info.DirectoryPath &amp; "\mods\", "'" &amp; Application.StartupPath &amp; "\bin\minecraft.jar'", TextBox1.Text, result)
      'info.Arguments = info.Arguments.Replace("\bin\minecraft.jar", My.Application.Info.DirectoryPath + "\bin\minecraft.jar")
      process.StartInfo = info
      process.Start()
  </code></pre>
  
  <p>But now I get the error: Unable to access jarfile "{path to minecraft.jar (correct path)}"
  Does anyone know why? And how to fix that error?</p>