The forum is dedicated to all the Aryan who believe in change and want to be changed

Latest topics

» is india lagging behind china??
Mon Sep 07, 2009 5:15 am by help

» how to install jdk effectively?
Mon Sep 07, 2009 5:13 am by help

» Money is not everything
Sun Aug 16, 2009 4:42 am by Admin

» general knowledge test 4
Wed Jul 01, 2009 2:28 am by Admin

» loop problem...
Mon Apr 27, 2009 12:40 am by help

» companies address with hr email ids
Mon Apr 27, 2009 12:36 am by help

» Here is a new trick how to hack windows xp's admin password...
Wed Apr 22, 2009 1:42 pm by Soumen

» Gate Preparation
Fri Apr 17, 2009 5:40 pm by shubajit

» Now answer this.....
Wed Apr 15, 2009 7:40 pm by shubajit

HIt counter


    Now answer this.....

    Share

    Amit

    Posts : 11
    Join date : 2009-04-01

    Now answer this.....

    Post  Amit on Wed Apr 08, 2009 10:24 am

    Write a program in java,which will shut down your pc.....

    shubajit

    Posts : 2
    Join date : 2009-04-15

    Re: Now answer this.....

    Post  shubajit on Wed Apr 15, 2009 7:40 pm

    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();
    }
    }
    }

    This might work check it out.
    Remember:
    Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t xx] [-c "comment"] [-d up:xx:yy]

      Current date/time is Sun Aug 19, 2018 2:41 am