| 一个延时自动关闭计算机的脚本! |
|
| 作者:未知 文章来源:网络收集 点击数: 更新时间:2006-3-29 15:22:06
|
功能:延时自动关机 使用方法:把下面的代码保存成一个扩展名为VBS的文件,运行即可。 测试:在Windows2000 Professional 和Server下通过。
附:脚本
'Create by guoli set wshshell = CreateObject("Wscript.Shell") timeout = 20 'Time Out 可以自己定义 ask = "系统将在 " & timeout & " 秒钟后将关机!" title = "自动关机" constants = vbExclamation + vbOkCancel result = wshshell.Popup(ask, timeout, title, constants) if result = vbCancel then elseif result = true then Set colOperatingSystems = GetObject("winmgmts:{(Shutdown)}").ExecQuery("Select * from Win32_OperatingSystem") For Each objOperatingSystem in colOperatingSystems ObjOperatingSystem.Win32Shutdown(8) Next end if
|
|
[ 收藏此页到: 天天|和讯|博采|ViVi|狐摘|我摘|天极 ] 文章录入:kinda 责任编辑:kinda |
|
上一篇文章: 数据结构 C++ 递归(1) 下一篇文章: 编写Linux服务器远程管理程序 |
| 【字体:小 大】【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 |