Board logo

标题: 如何在DOS下关闭系统 [打印本页]

作者: 小学生     时间: 2004-2-23 00:00    标题: 如何在DOS下关闭系统
以前在这论坛看过有关这个的命令,但是我一时忘了记下来,今天怎么也找不到。所以旧事重提,望大家多指教。

作者: 小学生     时间: 2004-2-23 00:00
有人看没人回,真不知道今天的高手哪去了

作者: 小学生     时间: 2004-2-23 00:00
找到了一个但是解答得不过详细http://model.chinajewelry.net/dos/dosbbs/dispbbs.asp?boardID=12&ID=9850

作者: 小学生     时间: 2004-2-23 00:00
还是要靠自己。终于找到了,这次比较详细http://model.chinajewelry.net/dos/dosbbs/dispbbs.asp?boardID=12&ID=9595

作者: wphs0326     时间: 2004-4-4 00:00
直接关电源

作者: 龙王     时间: 2004-4-5 00:00
除软件外可用 “win /z”关闭系统

作者: icefirewr     时间: 2004-4-6 00:00
不知道你想知道的是不是这个
shutdown -s
30十秒后关机
winxp以上版本
如果不是复制shutdown.exe 到系统目录下

作者: wphs0326     时间: 2004-4-7 00:00
真麻烦

作者: zhaomaoyu     时间: 2004-4-8 00:00
直接把电源拔掉就搞定了

作者: deomain     时间: 2004-4-8 00:00
以前的链接换这个
http://dos.e-stone.cn/dosbbs/dispbbs.asp?boardID=12&ID=9595

或者是这个
http://dos.e-stone.cn/dosbbs/dispbbs.asp?BoardID=12&replyID=63455&id=9850&star=1&skin=0



作者: zwq2009     时间: 2004-4-10 00:00
不会

作者: lyd-789     时间: 2004-5-15 00:00
在dos下输入restart
或用shutdown命令

作者: zhri     时间: 2004-5-17 00:00
......

......

绝倒。


作者: 1234567890     时间: 2004-5-17 00:00
支持 7楼、12楼
我也是这样关机的,要是重启的话,那就是 shutdown -r

作者: ivtu     时间: 2004-5-18 00:00
以下是引用lyd-789在2004-5-15 上午 01:32:32的发言:
在dos下输入restart
或用shutdown命令


作者: ▄︻┻┳═     时间: 2004-5-20 00:00
shutdown -s 就行了
想查看shutdown的另外一些其它命令键入shutdown回车就行了

作者: dbback     时间: 2004-5-25 00:00
shutdown

作者: kaede     时间: 2004-5-26 00:00
?!这也可以,我还以为是POWER呢

作者: shawell518     时间: 2004-5-27 00:00
学习啊

作者: Kinglion     时间: 2004-6-2 00:00
;*****************************;
; ;
; Code by BiTByte ;
; ;
; ;
;-----------------------------;
; ;
; SHUTDOWN PC IN DOS ;
; ;
; - Sourcecode is FREE - ;
; ;
;-----------------------------;
; ;
; assembling: ;
; ;
; tasm shutdown ;
; tlink /t shutdown ;
; ;
;-----------------------------;
; ;
; http://plop.at ;
; ;
;*****************************;

assume cs:code,ds:code
assume es:nothing,ss:nothing
code segment
.286
org 100h
start:
push cs
pop ds




call ProcessCommandline


cmp parameter,WRONGPARAMETER
jne @main1
mov ah,9
lea dx,WrongTxt
int 21h
jmp @exit
@main1:
cmp parameter,NOOUTPUT
je @main2
mov ah,9
lea dx,TitleTxt
int 21h
@main2:
cmp parameter,0
je @main30
cmp parameter,HELP
jne @main3
@main30:
mov ah,9
lea dx,HelpTxt
int 21h
int 20h
@main3:
mov ah,2ch
int 21h
call Print
@again:
mov countw,dh

cmp ignore,1
je @again2
mov ah,1
int 16h
jne @exit
@again2:
mov ah,2ch
int 21h
cmp countw,dh
je @again

call Print
cmp seconds,0
je @chknxt1
dec seconds
jmp @again
@chknxt1:
cmp minutes,0
je @nl
mov seconds,59
dec minutes
jmp @again
@nl:
call Poweroff
@exit:
xor ax,ax
int 16h
mov ah,9
lea dx,aborttxt
int 21h
int 20h


Print:
cmp parameter,NOOUTPUT
jne @prn
ret
@prn:
pusha
mov ax,seconds
lea di,outpsec
mov byte ptr ds:," "
call integer
mov ax,minutes
lea di,outpmin
mov byte ptr ds:," "
call integer

lea dx,outputtxt
mov ah,9
int 21h
popa
ret
Integer:
pusha
mov bx,10 ; set base (10 values)
mov byte ptr ds:,"0" ; write "0"
@decagain:
or ax,ax ; check if ax=0
je @decexit
xor dx,dx ; clear dx for div
div bx
add dl,"0" ; in dx=rest & add value "0"
mov ds:,dl ; write it
dec di ; sub pointer 1
jmp @decagain
@decexit:
popa
ret

ProcessCommandline:
pusha
mov si,81h
@proces1:
call RemoveSpaces
cmp byte ptr ds:,0dh
je @procescmdexit
cmp word ptr ds:,"m-"
jne @proces2
add si,2
call RemoveSpaces
call convert
mov minutes,ax
jmp @proces1
@proces2:
cmp word ptr ds:,"s-"
jne @proces3
add si,2
call RemoveSpaces
call convert
mov seconds,ax
jmp @proces1
@proces3:
cmp word ptr ds:,"h-"
jne @proces4
add si,2
mov parameter,HELP
call RemoveSpaces
cmp byte ptr ds:,0dh
je @procescmdexit
mov parameter,TOOMANYPARAMETERS
jmp @procescmdexit

@proces4:
cmp word ptr ds:,"n-"
jne @proces5
add si,2
call RemoveSpaces
mov parameter,NOOUTPUT
jmp @proces1
@proces5:
cmp word ptr ds:,"i-"
jne @proces6
add si,2
call RemoveSpaces
mov ignore,1
jmp @proces1
@proces6:
mov parameter,WRONGPARAMETER
@procescmdexit:
popa
ret

Convert:
mov parameter,OK
mov di,si
push si
call ToStringEnd
sub si,di
mov cx,si
pop si
push cx
call rinteger
pop cx
add si,cx
ret

RemoveSpaces:
cmp byte ptr ds:,20h
jne @removeexit
inc si
jmp removespaces
@removeexit:
ret

ToStringEnd:
cmp byte ptr ds:,20h
je @tostrexit
cmp byte ptr ds:,0dh
je @tostrexit
inc si
jmp tostringend
@tostrexit:
ret

rinteger:
push bx dx si
xor ax,ax
xor dx,dx
mov bx,10 ; set base 10
@rdecagain:
mul bx ; x10
mov dx,ax ; save old eax
lodsb ; load next value
cmp al,"0" ; value valid?
jb @rdecexit
cmp al,"9"
ja @rdecexit
and ax,0ffh
sub al,"0" ; yes -> sub ascii value
add dx,ax ; add new to old
mov ax,dx ; save new value
loop @rdecagain ; loop during the string
@rdecexit:
pop si dx bx
ret

PowerOff:
mov ax,5300h
mov bx,0
int 15h
push ax

mov ax,5308h
mov bx,1
mov cx,1
int 15h
mov ax,5308h
mov bx,0ffffh
mov cx,1
int 15h

mov ax,5301h
mov bx,0
int 15h
mov ax,530Eh
mov bx,0
pop cx

int 15h
mov ax,530Dh
mov bx,1
mov cx,1
int 15h
mov ax,530Fh
mov bx,1
mov cx,1
int 15h
mov ax,5307h
mov bx,1
mov cx,3
int 15h
int 20h


OK = 1
NOOUTPUT = 2
HELP = 3
TOOMANYPARAMETERS = 5
WRONGPARAMETER = 6

TitleTxt db "PLOP Shutdown program v1.1 Coded by Elmar Hanlhofer "
db "http://plop.at",0dh,0ah,0ah,"$"
WrongTxt db "Error: wrong parameter use -h for help",0dh,0ah,"$"

Param1Txt db "-m"
Param2Txt db "-s"
Param3Txt db "-h"
Param4Txt db "-n"

HelpTxt db "shutdown ",0dh,0ah,0ah
db " turns the pc off"
db 0dh,0ah,0ah
db " -s seconds",0dh,0ah
db " -m minutes",0dh,0ah
db " -n no output",0dh,0ah
db " -i ignore key press to abort",0dh,0ah
db " -h help",0dh,0ah,"$"

OutputTxt db 0dh,"Shutdown in Minutes: "
outpmin db " Seconds: "
outpsec db " $"

ignore db 0
aborttxt db 0dh,"Abort ",0dh,0ah,"$"

parameter db 0
minutes dw 0
seconds dw 0
count db ?
countw db ?


code ends
end start




作者: bush     时间: 2004-6-2 00:00
DOS没有关机的“命令”, 哪些都是来自外部的程序……

作者: 谈笑风生123     时间: 2004-6-2 00:00
前几天在一个网站看到有一个“off.exe"的程序,不过忘记是哪个了?

作者: 如是大师     时间: 2004-6-2 00:00
相关的关机命令很多的.甚至可以用debug程序在dos下实现..

作者: chenjie20214     时间: 2004-6-3 00:00
很简单,拔掉电源,就是了,
还有我的机子,没坏,但是就是无法软关机,后来我就只好拔线了,还是P4的CPU呢?