Write a program in java,which will shut down your pc.....
Search
Latest topics
Top posters
HIt counter
2 posters
Now answer this.....
shubajit- Posts : 2
Join date : 2009-04-15
- Post n°2
Re: Now answer this.....
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]
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]
|
|
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