public class BatchTest
{
public static void main(String[] args)
{
Runtime run = Runtime.getRuntime();
try
{
Process p = run.exec("cmd start /c
D:/test.bat");
System.out.println(p.exitValue());
}
catch (Exception e)
{
e.printStackTrace();
}
System.out.println("FINISHED");
}
}


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Core Java Interview Questions

why java does not contain pointers?

13 Answers   Infosys, TCS,


what is for datainputstream?

1 Answers  


When abstract methods are used?

1 Answers  


what is object deep copy and shallow copy and why it is required?

2 Answers  


What is an object class?

0 Answers  






Which are different kinds of source code?

0 Answers  


What is meant by polymorphism?

0 Answers  


Can we define constructor in inner class?

0 Answers  


What are Font and FontMetrics classes?

1 Answers  


why are there separate wait and sleep methods? : Java thread

0 Answers  


Is 64bit faster than 32 bit?

0 Answers  


How do you test a method for an exception using junit?

0 Answers  


Categories