Click here to Skip to main content
15,885,159 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
I want to develop a program which can control the PC auto power on. It must be realized by C or C++. But right now, I have no idea how.
By the way, the program should run on Windows, I also plan to develop it using VS2008. Who can tell me how to do that?
Posted
Updated 12-May-10 4:07am
v2

This will only work when the computer is in sleep or hibernate state:
the easy solution: just schedule a task, and check the 'wake system to run this task' box.
doing it in C/C++: read This[^]

Note that this will only work if the system is in the S3 or S4 state as stated above.
If the computer has been shutdown or powered off by other means, this will not work. It will also only work if the kit has an ACPI-compliant bios (Starting with Vista, windows does not accept anything else). Your mileage on XP may vary.

Some computers have a bios that allow you to setup a waking time through the setup screen. This is not controlled by windows, and controlling that requires a specific BIOS device driver.
 
Share this answer
 
So the program will run on a different machine to the machine you want to power on ? Or are you so clueless as to think an off computer can run your code ? If the former, then you can set the wake on LAN functionality on the motherboard, and then wake it that way.
 
Share this answer
 
Comments
Michel Godfroid 12-May-10 10:36am    
Actually a computer in S4 state is pretty much off. If not setup for WOL, it's indistinguishable from power-off, except for the boot loader pointing to the hibernate file :-)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900