復(fù)制代碼 代碼如下:
Dim mytime,myout1,myout2
mytime=null
mytime=InputBox("請輸入定時時間(格式20:10:05)"vblf"如果想倒計(jì)時關(guān)機(jī),請輸入倒計(jì)時時間"vblf"(單位/分鐘)"vblf"輸入‘xxx'可以馬上關(guān)機(jī)"vblf"退出點(diǎn)‘取消'","定時關(guān)機(jī)","1")
Set wshshell=wscript.createobject("wscript.shell")
If IsNumeric(mytime)=False Then
If IsDate(mytime)=True Then
wshshell.run "at "mytime" shutdown -s" '定時關(guān)機(jī)在任務(wù)列表中
myout1=MsgBox("定時成功!電腦將在"mytime"關(guān)機(jī)!放棄關(guān)機(jī)請點(diǎn)‘取消'!",vbokcancel,"定時關(guān)機(jī)")
If myout1=vbcancel Then
wshshell.run "at /delete /y"
MsgBox "關(guān)機(jī)已取消!",64,"定時關(guān)機(jī)"
End If
Else
If mytime="xxx" Then
wshshell.run "shutdown -s -t 0"
End If
MsgBox "輸入錯誤!請重新輸入!",64,"定時關(guān)機(jī)"
End If
Else
If mytime>600 Or mytime=0 Then
MsgBox "輸入錯誤!倒計(jì)時不能多于10小時(600分鐘)!",64,"定時關(guān)機(jī)"
wscript.quit
End If
wshshell.run "shutdown -s -t "mytime*60
myout2=MsgBox("設(shè)置成功!電腦將在"mytime"分鐘后關(guān)機(jī)!放棄關(guān)機(jī)請點(diǎn)‘取消'!",vbokcancel,"定時關(guān)機(jī)")
If myout2=vbcancel Then
wshshell.run "shutdown -a"
MsgBox "關(guān)機(jī)已取消!",64,"定時關(guān)機(jī)"
End If
End If
復(fù)制代碼 代碼如下:
set diaolei=createobject("wscript.shell")
dim shijian,guanji,hua
shijian=time
hua=inputbox("請輸入你要用什么單位關(guān)機(jī) 1 代表分鐘 2 代表小時 3 代表天")
if hua=1 then
guanji=inputbox("請輸入你要幾分鐘后關(guān)機(jī)")
if datediff("m",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
elseif hua=2 then
guanji=inputbox("請輸入你要幾小時后關(guān)機(jī)")
if datediff("h",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
elseif hua=3 then
guanji=inputbox("請輸入你要幾天后關(guān)機(jī)")
if datediff("d",shijian,time)>=guanji then
diaolei.run "rundll32.exe user.exe,exitwindows"
diaolei.run "shutdown -s -t 0"
endif
您可能感興趣的文章:- 自己寫的一個定時關(guān)機(jī)或重啟的vbs腳本
- vbs實(shí)現(xiàn)的定時關(guān)機(jī)、重啟的腳本和程序
- vbs實(shí)現(xiàn)的eMule電驢自動關(guān)機(jī)腳本代碼
- VBS 斷網(wǎng)后自動關(guān)機(jī)30秒后
- Crack8 VBS整人腳本 你不說你愛我 就關(guān)機(jī)
- VBS中獲取系統(tǒng)本次及上次開關(guān)機(jī)時間的代碼(WinXP/win2003/Win7兼容版)
- vb下的惡搞關(guān)機(jī)程序
- VB關(guān)機(jī)惡搞小程序