Friday, July 31, 2009

How to shutdown computer using "c" or "C++" program?

How to shutdown computer using "c" or "C++" program?


can anyone send ma a c or c++ program to shutdown the computer....plzz

How to shutdown computer using "c" or "C++" program?
#include%26lt;bios.h%26gt;


void main()


{


geninterrupt(0x19);


}





//EDIT


this will work with DOS operating systemonly and not with windows
Reply:hi


use shellexecute as bellow :


ShellExecute(0, "OPEN", "shutdown.exe -t 20", 0, 0, SW_SHOWNORMAL);





shutdown is the program in XP that we can run from command line to shut down a computer.


bye for now


No comments:

Post a Comment