Search code examples
winapistartup

API to turn on your computer


I'm making a small on-line clock (both for fun and to learn a bit more of PHP and JavaScript) started it because I actually need an alarm clock and this would be easier than buying one (don't ask)

Now I wanted to know one thing, I know it's impossible to turn on/off you're computer from a browser, but a friend asked me if I could do him a small addon/program that would fetch the alarm time he added there, and would turn his computer on so it would let it wake up.

I know turning on must be pretty much impossible, but turning on from sleep/hibernate maybe?

Anyone knows any API to do this? Windows or Mac, or cross platform.

Just for curiosity the alarm clock is here http://www.my-clock.net

Edit:

On the wiki page, wake-on-lan says it requires to turn the BIOS power to the network-board, is there any way around this? Or are today's computers already ready for this kind of protocol?


Solution

  • There could be two solutions:

    1. Use Wake-on-LAN as was suggested. But you must have another machine up on that LAN, it doesn't work over the Internet itself. So it goes like You -> [Internet] -> Waker -> Your friend.
    2. You can set his RTC wakeup alarm over the Internet while his machine is still up and running. Then his computer will wake at the specified time.

    Both would work even if the computer is completely powered-off.