I would like to perform the following windows command under java :
rmdir /s C:\Main\Second\Third
Y
The problem is that there is 2 commands to run, one for the remove and one as confirmation (a simple "Y", as you can see).
I know it's feasable but I didn't manage to make it.
String rmCommand = "cmd.exe /c rmdir /s /q C:\\Main\\Second\\Third";
Runtime runt = Runtime.getRuntime();
Process process = runt.exec(rmCommand);
So my question is : How to run these 2 above commands in prompt thanks to JAVA code.
EDIT : I modified a bit the initial code according to some proposals but it still doesn't work ... I don't know what to do.