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

what is the need of the Ajax?

5 Answers   iFlex,


How do you identify if jvm is 32-bit or 64-bit from java program?

0 Answers  


How are this() and super() used with constructors in java programming?

0 Answers  


What will happens if you opened Internet Explorer 4 times?

2 Answers  


What is integer valueof?

0 Answers  


different between exception and error? explaim check and uncheck exception

4 Answers  


Explain parallel processing in java8?

0 Answers  


How to prevent to create multiple objects of a java class?

3 Answers   ASD Lab, TCS,


What is ide with example?

0 Answers  


What will happen if static modifier is removed from the signature of the main method?

0 Answers  


what is the purpose of class "Object" which is base class for all classes?

3 Answers  


What is Mutex (Mutual Exclusion Object) ?

0 Answers   Ciena,


Categories