Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please What is the sutdown command????

Status
Not open for further replies.

8Ball

Programmer
Jun 6, 2001
2
MT
ALL I want is the shut down command to shut down the computer, please don't tell me to look in the help as i have already
 
This isn't as easy as it used to be. Once-upon-a-time you could call Interrupt zero, creating a processor exception, shutting down the machine. With Win9x, it just crashes the machine.

You might try...
[tt]
WinDir$ = ENVIRON$("windir")
KillWin$ = WinDir$ + "\Rundll.exe User.exe,ExitWindows"
SHELL KillWin$
[/tt]

...but this might be more work than what it is worth. Windows doesn't like to shut down DOS apps automatically and it is likely to prompt you to click okay to close your program and Windows or click Cancel to continue working.

Somebody post here if you know an easy way to do this using BASIC (with or without calls to the ROM BIOS).

VCA.gif

Alt255@Vorpalcom.Intranets.com​
 
"\Rundll.exe User.exe,ExitWindows" should go on one line. Obviously.

VCA.gif

Alt255@Vorpalcom.Intranets.com​
 
Thanks, Toshi. Any thoughts on shutting down or restarting a machine where APM isn't enabled?
VCA.gif

Alt255@Vorpalcom.Intranets.com​
 
Alt255,
I think your way is the best way for Winxx machines.
None of the low-level techniques work on the new Windows 32 environment. The most they do is close the DOS box. In the WinNT/2K environments, shutting down the computer may be disabled for a given account. In that case, there's no way to do it, as far as I know.

boot1:
DEF SEG = &H40
POKE &H473, 12 '0000 for cold boot
POKE &H472, 34
DEF SEG = -1: '-1==&HFFFF
CALL ABSOLUTE(0)
END

boot2:
OUT 100, 254

boot3:
SHELL "START"

boot4:
'int 19h using CALL INTERRUPT(&h19,regs,regs)

boot5:
OUT &H64, &H92

 
As an aside, using a CALL to FFFF:0000 or OUT &H64, &H92/&HFE will cause windows to kill the DOS box, so you could use the RunDLL32 method followed by the old-fashioned method to work -- at least to some extent -- around Windows asking whether you want to kill the DOS window or not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top