if (winSystem()) {
PrintWriter writer = new PrintWriter(new OutputStreamWriter(shutdownProcess.getOutputStream(), Charsets.UTF_8));
try {
//On windows, user needs to press any key on the console
//for the process to exit. Wait a bit for message "Press any key"
new MessageWaiter(shutdownProcess).waitFor("Press any key to continue");
writer.write("y");
writer.flush();
} finally {
writer.close();
}