public static void main(String args[]) {
try {
SPRemote spremote = SPServer.getRemote(args[0]);
int cmd, ret;
cmd = Integer.parseInt(args[1]);
if (cmd == 1) {
ret = spremote.shutdownComputer();
if (ret == 0)
System.out.println("Shutdown Success.");
else
System.out.println("Shutdown Failled.");
}
else if (cmd == 2) {
ret = spremote.restartComputer();
if (ret == 0)
System.out.println("Restart successfull.");
else
System.out.println("Restart failled.");
}