Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Trying to replicate your problem, I successfully run commands with much much much much longer argument line.<br> Try to insert </p> <pre><code> try { p.waitFor(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } </code></pre> <p>after you execute your command (in place of those commented <code>sleep() ...</code>) to make sure you allow it to finish. </p> <p>There is actually another problem with this approach (which I initially thought may be your problem) - if your process writes enough data to fill it's console buffer it may block, as described here (javadoc for process): </p> <blockquote> <p>Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, or even deadlock.</p> </blockquote> <p>so you should read it first: </p> <pre><code>InputStream is=process.getInputStream(); BufferedReader br= new BufferedReader(new InputStreamReader(is)); String line=new String(); while ((line=br.readLine())!=null) System.out.println (line); //do something real here </code></pre> <p>If you do not want to read your bat output (and I do not see you do) you can skip all that and just run your command in it's separate window:<br> <code>cmd /c start \"my command\" c:/temp/startup.bat args</code></p> <p>(note about second form with working dir, use <code>cmd /c startup.bat arguments</code> to get rid of that 'not found' exception)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload