I want my java program to do the following things:
Access cmd and execute the commands: "d:", "cd D:\Java Projects\imageProject", "screenshot-cmd"
I tried to google that and found some code examples but none of them worked because I probably have no idea what i'm doing.
This is what I have now:
static void imageFromCMD(){
ProcessBuilder builder = new ProcessBuilder(
"cmd.exe", "d:", "cd D:\\Java Projects\\imageProject",
"screenshot-cmd");
Process p = builder.start();
}
that code doesn't fail but i'm not getting the output (image in the dir) that i expect
I guess I'm missing the "sending" part, but how exactly can I do it?