How to shut down pc in lan?

Closed
deepa - Mar 14, 2009 at 04:05 AM
d.hame35 Posts 9 Registration date Tuesday March 10, 2009 Status Member Last seen June 10, 2009 - Mar 15, 2009 at 04:46 AM
Hello,


i am working on project Green Lan.In which i hava a module such as shut down the pc in lan through server.
but i know we directly send shutdown cmd from one pc to other .I want some other method using java prog.
Related:

1 response

d.hame35 Posts 9 Registration date Tuesday March 10, 2009 Status Member Last seen June 10, 2009 1
Mar 15, 2009 at 04:46 AM
Hello,

Well I have tried that one in Java and it works but I dont know if it does work in LAN:

import javax.swing.JOptionPane;
public class shutdown{
public static void main(String[] args){
try{
Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("cmd /c shutdown -s");
} catch (Exception ew){
JOptionPane.showMessageDialog(null, ew.toString());
ew.printStackTrace();
}
}
}
0