error on giving cli command to subprocess of the get.Runtime.exec()
<p>am having problem that after the cmd.exe is called the program show the output as</p>

<p>run:
sucesss
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.</p>

<p>C:\Users\prodesign\Documents\NetBeansProjects\Procs></p>

<p>after > this it just hangs 
it tried to send the "exit\n" string by the OutputStreamWriter but got no luck
the code of the java is as follows</p>

<pre><code>public static void main(String[] args) {

Scanner scan = new Scanner(System.in);     

    try
{
  int exitVal;
  char c;
  String ch="exit\n";
 Process process = Runtime.getRuntime().exec("cmd.exe");
  //"cmd /c C:/hello.exe",}
 OutputStream stdin = process.getOutputStream ();
 InputStream stderr = process.getErrorStream ();
 InputStream stdout = process.getInputStream ();

 BufferedReader reader = new BufferedReader (new InputStreamReader(stdout));
 BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));
 System.out.println("sucesss");
 do{ c=(char)reader.read();
 System.out.print(c);

 }while(c!='&gt;');

writer.write(ch);

exitVal=process.waitFor();
System.out.println("Exited with error code "+exitVal);

 }catch (Exception e)
 {
 e.printStackTrace();
 }
}
}
</code></pre>

<p>thanks</p>
