title: How to open a .jar by clicking on a button in C++?
body: <p>I want to open a .jar file when a button is clicked in Windows. I have the following code:</p>
  
  <pre><code>private: System::Void btnStartServer_Click(System::Object^  sender, System::EventArgs^  e) {
      STARTUPINFO si;
      PROCESS_INFORMATION pi;
      int spi=sizeof(pi);
      int ssi= sizeof(si);
      ZeroMemory( &amp;si, sizeof(si) );
      si.cb=sizeof(STARTUPINFO); //sizeof(si);
      ZeroMemory( &amp;pi, sizeof(pi) );
  
      char b = 0;
      b = CreateProcess("C:\\Program Files\\Java\\jre7\\bin\\java.exe ", "-jar craftbukkit.jar", NULL, NULL, 0, CREATE_NO_WINDOW, NULL, NULL, &amp;si, &amp;pi);
  
      btnStartServer-&gt;Text = String::Format(L"{0}", b);
  }
  </code></pre>
  
  <p>But when I press the button the button's text changes to "1", but I don't see any proccess  called "java" in Task Menager.</p>
  
  <p>If you know how to open, read output and give input to/from a .jar file, I'd appreciate if you answered: <a href="https://stackoverflow.com/questions/15371939/how-to-open-read-output-and-give-input-to-a-jar-file-with-c">How To Open, Read Output and Give Input To a .jar file with C++?</a>.</p>
  
  <p>Any help would be appreciated.</p>