利用vbs设计自动关机脚本(win)

Dim time,mousedown
time=InputBox(“请输入你想关机的时间”&vblf&”格式(20:10:05)必须是英文下的:”,”定时关机”)
Set wshshell=wscript.createobject(“wscript.shell”)
If IsDate(time)=True Then
wshshell.run “at “&time&” shutdown -s”
mousedown=MsgBox(“定时成功!电脑将在”&time&”关机!如果想放弃关机单击‘取消’!”,vbokcancel,”定时关机”)
If mousedown=vbcancel Then
wshshell.run “at /delete /y”
MsgBox “关机已取消!”,64,”定时关机”
End If
End if
MsgBox “输入格式错误,请重新输入”,”定时关机”

您可能还喜欢...

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据