>
> > import java.io.IOException;
> >
> > public class Main  {
> >
> >     public static void main(String[] args)throws IOException {
> >         Runtime runtime=Runtime.getRuntime();
> >         Process proc=runtime.exec("shutdown now  -h 0");
> >         System.exit(0);
> >            }
> > }
>

The command is  [1] shutdown -h now ;

 [1] = sudo is used if user do not have permission for shutdown.
Make sure user have proper permission for shutdown command execution.

-- 
With Regards,
Gaurav Paliwal
http://gauravpaliwal.com

-- 
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer

Reply via email to