本帖最后由 ygqiang 于 2016-3-21 12:32 编辑
初步解决了....- st=#23:45#
- et=#05:45#
-
- Set Ws= WScript.CreateObject("WScript.Shell")
-
- Do
- If (Time>st And Time<#23:59:59#) Or (Time>#0:00# And Time <et) Then
- [说] "收拾收拾准备睡觉啦!5分钟后我会把你的电脑关掉哦!!!"
- ws.Run "shutdown /f /s /t 300", 0,false
- WScript.quit
- Else
- '[说] " 时间还没到"
- End If
- Wscript.Sleep 40000 '减少CPU占用 每40秒检测一次
- Loop
-
- Function [说]([内容])
- [说]= ws.popup(vbcrlf&[内容]&vbcrlf,10,"妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪",8+8)
- End Function
复制代码
- statime=#23:35#
- endtime=#05:35#
- sameday = true
- if statime>endtime then sameday = false
- Set Ws= WScript.CreateObject("WScript.Shell")
-
- Do
-
- ringtime = false
- if sameday = true and Time>statime and Time<endtime then
- ringtime = true
- else if sameday = false and (Time>statime or Time<endtime) then
- ringtime = true
- else
- '[说] "哈哈"
- end if
- end if
-
- if ringtime = true then
- [说] "收拾收拾准备睡觉啦!5分钟后我会把你的电脑关掉哦!!!"
- ws.Run "shutdown /f /s /t 30", 0,false
- wscript.quit
- Else
- '[说] "时间还没到"
- End If
- Wscript.Sleep 40000 '减少CPU占用 每40秒检测一次
-
- Loop
-
-
- Function [说]([内容])
- set [wscr]=wscript.createObject("wscript.shell")
- [说]= [wscr].popup(vbcrlf&[内容]&vbcrlf,10,"妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪妈妈咪",8+8)
- End Function
复制代码
|