Sunday, 5 November 2017

Java program to shutdown windows7

import java.io.*;
class Main
{
public static void main(string[args]) throws IOExcption
{
char ch ;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
string s;
System.out.println ("Do you want to shutdown your computer now (y/n) \n ") ;
s=br.readLine( ch ) ;
if ( ch == 'y' || ch == 'Y' )
system( "C: \\ WINDOWS\\ System32 \\ shutdown /s" ) ;
system( "shutdown" );
return 0 ;
}
}

No comments:

Post a Comment