Wayne Liu

Greenhorn
+ Follow
since Dec 01, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Wayne Liu

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();
}

}

}

-------------------------------------------------
15 years ago