I tried open a command prompt using java program, how to execute the some exe file in this command prompt using java code.
Asked
Active
Viewed 137 times
1 Answers
3
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.

AlexR
- 114,158
- 16
- 130
- 208