Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force startup a computer automatically?

Tags:

java

We know how to force shutdown an computer using Java. For example, the following code works fine for force shutdown:

public static void main(String arg[]) throws IOException{
    Runtime runtime = Runtime.getRuntime();
    Process proc = runtime.exec("shutdown -s -t 0");
    System.exit(0);
}

Now, suppose if I want to force startup a computer (which is in shut down state), at a particular time, is it possible to do in Java or any other language?

like image 602
Gokul Nath KP Avatar asked Mar 26 '13 09:03

Gokul Nath KP


People also ask

Can I make my computer start up automatically?

Go to the Start menu, type Power Options in Search box. Click it from the result. Then click Additional power settings under related settings. Click Change plan settings > Change advanced power settings, expand the "Sleep" section, expand the "Allow wake timers" section, and ensure it's set to "Enable".

How do I force my computer to start?

Force a restart If the usual computer repair restart methods aren't working, you can force your computer to restart by holding down the power button until it shuts down, then pushing it again to start your machine. This should work.

Can I schedule my PC to restart on its own?

Expand Task Scheduler Library and select the Schedule Reboot folder. Then right-click on it and select Create Basic Task. When you select Create Basic Task, it will open a wizard. Name it Reboot and click Next.


2 Answers

You need something to trigger the startup. The best way to trigger this is Wake On Lan.

If you want to do this in Java, this might be a good resource.

like image 150
Erik Pragt Avatar answered Sep 19 '22 20:09

Erik Pragt


In addition to wake on lan, there are IPMI devices that run on some server-grade hardware that is connected to the motherboard and can control power as well as provide serial console output over a network connection. This computer is running all the time, but I'm not familiar with any you can load your own code onto.

You can control this device remotely to power control the server that is off from any language including java.

http://en.wikipedia.org/wiki/Intelligent_Platform_Management_Interface

like image 40
xaxxon Avatar answered Sep 17 '22 20:09

xaxxon