Add command to cmd history

2019-07-10 04:12发布

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?

0条回答
登录 后发表回答