Tuesday, July 14, 2009

How to restart the system writing program using c/c++ language?

i want to know coding part (i mean program) how to restart my computer writing my own program using either c/c++ language

How to restart the system writing program using c/c++ language?
This trick is done, using the Windows API. Visit this link for some details:





http://www.codersource.net/mfc_shutdown_...





I hope this helps
Reply:no idea dont get a virus
Reply:frankly, I dont know if there is a uniform way of doing this.


but I can suggest a quick and dirty hack to do this





use something like


system("shutdown -r") on windows/linux etc.





These will invoke the native OS calls to do what you want. Its also really ugly. I am hoping someone else gives you a better way to solve this problem!
Reply:Using interrupts.. Refer Interrupt programmng in C - byu yeshwant kanethkar
Reply:There are two methods





1. Call the "shutdown.exe" (with params "/r" if you are on windows)





2. Send the system the appropriate termination signal


No comments:

Post a Comment