I'm trying to run console program inside windows cmd terminal. It works. But program which I run don't added to history.
String[] command = {"cmd.exe", "/C", "\"start cmd.exe /K \"" + commandLine + "\"\""};
ProcessBuilder builder = new ProcessBuilder().command(command);
start = builder.start();
I want to add ability to users to easily rerun this program lately. Is there any way to add command to cmd.exe history?