| Author |
How do you prevent command prompt pop-up/close it after a /C Start command?
|
Wayne Liu
Greenhorn
Joined: Dec 01, 2008
Posts: 1
|
|
As stated in the topic, can anyone show me the codes i need to prevent a command prompt pop up or close it after running a /C Start command? The code below will start a command prompt and "echotoscreen" is a .bat file with "echo %1, echo%2" commands that will accept the variables "msg" and "hp" respectively. Any help will be greatly appreciated! Thanks. ------------------------------------------------- import java.io.*; public class Test4 { public static void main(String args[])throws IOException { String msg = "\"Your OTP is 493043\""; String hp = "93495029"; Process p=Runtime.getRuntime().exec("cmd /C start echotoscreen " + msg+" " +hp); BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream())); String line=reader.readLine(); while(line!=null) { System.out.println(line); line=reader.readLine(); } } } -------------------------------------------------
|
 |
 |
|
|
subject: How do you prevent command prompt pop-up/close it after a /C Start command?
|
|
|