⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 定时关机.vbs

📁 定时关机工具 输入多少时间后关机(单位:秒)
💻 VBS
字号:
'****************************************                              
'*by r05e                                                            
'*关机                                                                    
'****************************************
Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem")
Function shut()
setTime=InputBox("请输入多少时间后关机(单位:秒)"," 定时关机", "", 100, 100)
If setTime<>"" Then
IF IsNumeric(setTime) Then                                    
timeS=setTime*1000
wscript.sleep timeS                                      
                                                                         
                                                                                  
For Each objOperatingSystem in colOperatingSystems
    ObjOperatingSystem.Win32Shutdown(1)
Next
Else wscript.echo "输入错误,请重试"
shut()                                    
End If
Else wscript.echo "操作取消"
End If
End function
shut()

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -