I tried open a command prompt using java program, how to execute the some exe file in this command prompt using java code.
Share
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.
Runtime.getRuntime().exec()or using ProcessBuilder.Now, if you want to open command prompt on windows run pass “cmd.exe” to
exec()method. You have to find which command to run for each other OS your application is targeted for.