I\'m working on a project, and it will give you a list of Windows commands. When you select one, it will perform that command. However, I don\'t know how to do that. I was g
an example. 1. create cmd 2. write to cmd -> call a command.
try {
// Execute command
String command = "cmd /c start cmd.exe";
Process child = Runtime.getRuntime().exec(command);
// Get output stream to write from it
OutputStream out = child.getOutputStream();
out.write("cd C:/ /r/n".getBytes());
out.flush();
out.write("dir /r/n".getBytes());
out.close();
} catch (IOException e) {
}