tags:

views:

64

answers:

1

Can I create a simple program to power off the windows machine immediately? I would like the behavior to be like pressing PWR OFF/RESET button. So the power is cut off immediately. Is there any way to send a software interrupt to motherboard to make this happen?

A: 

You can easily do this in assembly language like MASM. Here's small tutorial from Microsoft: http://support.microsoft.com/kb/68805

Also you can try to execute int 19h assembly command.

But I'm not sure if theese methods will work under win2k and later. To get them working you should create a driver then.

Andrew
Thank you. I've tried both C code and assembly code but it didn't work on my machine. It seems that neither I can't set bios pointer to the desired address nor I can't directly jump to the reboot address. My machine is running windows xp service pack 3.
HcTeP
The link is for MS-DOS. Not Windows 3.11, 95, or any other Microsoft OS from the last two decades. Note that is says "Works on 8086, and some 80286/80386 machines" !
MSalters