Does anyone know how to give Windows 2000/NT a "Power Button" command? I just want the computer to reboot! No questions asked! No windows shutdown! Just as if you pressed the reset button...
Any ideas?
Printable View
Does anyone know how to give Windows 2000/NT a "Power Button" command? I just want the computer to reboot! No questions asked! No windows shutdown! Just as if you pressed the reset button...
Any ideas?
Im not sure there is an API that sends a short to the reset jumper on the motherboard for the computer to restart immediatly... also if yer in NT and u reboot like that u stand a good change of screwin the OS...
if thats yer intention, i dont think windows added an API that will screw their OS like that.. (i could be wrong)
CiD -=ii=-
Don't tell me if this is not what you want.Code:Public Declare Function ExitWindowsEx Lib "user32.dll" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
Const EWX_FORCE = 4
'Force apps to quit
Const EWX_REBOOT = 2
'Perform a full reboot
'The code that makes it work:
ExitWindowsEx(EWX_REBOOT Or EWX_FORCE, 0)
:D Just joking
Hope it helps,
Bye!
I'd say there's no power off -function. The fastest way to shutdown is like V(ery) Basic said with ExitWindowsEx, as I remember there's a parameter to exit without saving aso.
There is a contant for poweroff, but it only works sometimes:
I just thought I'd add thatCode:Const EWX_POWEROFF = 8
I like this function beacuse if you read it it goes like this:
Exit Window Sex
Tihihihi.
I'm very infantile about these things