Computersight > Programming > Java

Java Code to Shut Down Computer

A piece of code that I made that will shut down the computer. What I did was jared it and put it on my desktop, so when I click on it my computer will shut down.

import java.io.IOException;
 class ShutDown {
   public static void main(String[] args) throws IOException{
 	  System.out.println("Good Bye!");
 	  Process p = Runtime.getRuntime().exec("C:/WINDOWS/system32/shutdown.exe -l");
 }
 }

4
Liked It
I Like It!
Related Articles
Laptop Vs. Desktop Computers  |  Compaq Computer Recovery
Latest Articles in Java
How to Make an Analog Clock for Your Website  |  Collection Framework: List Interface
Comments (2)
#1 by sonia, Apr 6, 2007
where i can find a code like that to put it in my myspace page???????
#2 by Speed Limit, Dec 1, 2007
This is useful.
Post Your Comment:
Name:  
Copy the code into this box:  
Post comment with your Triond credentials?
Inside Computersight

Communication & Networks

 /

Computers

 /

Hardware

 /

Operating Systems

 /

Programming

 /

Software


Popular Tags
Popular Writers
Powered by
Computersight
About Us
Terms of Use
Privacy Policy
Services
Submit an Article
Advertise with Us
Contact

© 2007 Copyright Stanza Ltd. All Rights Reserved.