- restTime =inputbox("请输入关机时间(单位:秒)","定时关机","600")
- if restTime = "" then wscript.quit
- Dim i
- Set Tips = CreateObject("WScript.Shell")
- For i = restTime To 1 Step -30
- Con = Tips.popup ("当前时间剩余" & i & "秒,每30秒更新一次",30,"计时",2)
- If Con = 3 then wscript.quit
- Next
- Set Finally = CreateObject("WScript.Shell")
- Finally.popup "10秒后关机",1,"计时",0
- Set Tips = Nothing
- Set Finally = Nothing
- set WSHshell = wscript.createobject("wscript.shell")
- WSHshell.run "cmd.exe /c shutdown -s -t 10"
- #该片段来自于http://www.codesnippet.cn/detail/200520133443.html
来源: http://www.codesnippet.cn/detail/200520133443.html