3

I have an old PC that has no power switch (it's a long story). It is running DOS 6.20. I am looking for an interrupt call or anything to turn off the computer using software as I need it to turn off after unattended operations. I am a little familiar with ASM and interrupts and I'm not afraid to experiment.

5
  • I'm fairly sure there's no way to do this, but I'm not absolutely sure so I'm not listing this as an answer. Commented Jun 28, 2016 at 13:31
  • What about the shutdown command? Commented Jun 28, 2016 at 13:34
  • 1
    Search for a tool that powers off using APM (older) or ACPI (possibly too complex for DOS). Commented Jun 28, 2016 at 13:41
  • You can freely edit your own posts but for your protection, it must be done under the original user account. It looks like you created a second account, which will also interfere with commenting on your thread and accepting an answer. See superuser.com/help/merging-accounts to merge your accounts.
    – fixer1234
    Commented Jun 29, 2016 at 2:31
  • stackoverflow.com/questions/21463908/… Commented Jun 29, 2016 at 4:38

1 Answer 1

3

I am looking for an interrupt call or anything to turn off the computer

If you have ATX compatible hardware then you can use ATXOFF.COM

ATXOFF.COM 1.3 english

This simply turns off power on ATX Systems (no cache-flushing!), but it requires APM 1.2 to work.

Source dostools

The ATXOFF.COM I have is only 40 bytes. Hardly worth griping over, or continuing this childish gloating.

Simply put. If the OP really wants a batch only solution, just download a copy of ATXOFF, and create a DEBUG (native to 6.22) script from it. Like this...

=== ATXOFF.SCR ===
A
MOV     AX,5301
XOR     BX,BX
INT     15
MOV     AX,530E
XOR     BX,BX
MOV     CX,0102
INT     15
MOV     AX,5307
XOR     BX,BX
INC     BX
MOV     CX,0003
INT     15
RET

G
ATXOFF.COM Version 1.3
=== End of ATXOFF.SCR ===

Then all that needs done is to input the script into DEBUG in the batch.

debug < atxoff.scr > nul

As mentioned elsewhere, this requires atx hardware, and when run, the power goes off immediately, so be sure to flush your drive cache first.

Source shutdown and rebooting in batch files

2
  • How would one do the 'cache flushing' step then? I imagine it would involve smartdrv? Commented Jun 29, 2016 at 4:28
  • (Also, can someone tell me if XOR BX,BX; INC BX is equivalent to MOV BX,0001?) Commented Jun 29, 2016 at 4:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .