I executed a batch file from within my Java code like below:
Runtime.getRuntime().exec("cmd /c start update.bat");
I want to know whether can I get any notification when this batch script completes. Is it possible?
Regards,
Anand
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Keep a reference to the Process and waitFor the process to stop, this will halt your excecution.
Do as the good example in this link (When Runtime.exec() won’t). If you read the whole article you will avoid and understand many pitfalls of the exec command.
Then you can read up on
ProcessBuilderwhich is a more modern way to invoke other processes.