| 关键词: nbsp timeout objOperatingSyst colOperatingSyst constants Shutdown wshshell 自动 result title |
功能:延时自动关机使用方法:把下面的代码保存成一个扩展名为VBS的文件,运行即可。测试:在Windows2000 Professional 和Server下通过。附:脚本'Create by guoliset wshshell = CreateObject("WScript.Shell")timeout = 20'Time Out 可以自己定义ask = "系统将在 " & timeout & " 秒钟后将关机!" title = "自动关机"constants = vbExclamation + vbOkCancelresult = wshshell.Popup(ask, timeout, title, constants)if result = vbCancel thenelseif result = true then Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems ObjOperatingSystem.Win32Shutdown(8) Nextend if |
|
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系
[邮箱地址] 删除
|