定时关机脚本

原文链接:http://www.cnblogs.com/zhy2002/archive/2010/09/03/1817269.html

var winshell = WScript.CreateObject("WScript.Shell");

function shutdown30()
{
 WScript.Sleep(1000*60*30);
/*winshell.SendKeys("^+{ESC}");
WScript.Sleep(3000);
winshell.SendKeys("%f");*/
 winshell.SendKeys("^{ESC}{UP}~{DOWN}~");
}

if(winshell.Popup("Are you sure?",30,"Shutdown in 30 min",4+32)!=7)
{
 shutdown30(); 
}

 

如果要取消关机,打开任务管理器,终止windows script host的进程。

转载于:https://www.cnblogs.com/zhy2002/archive/2010/09/03/1817269.html

上一篇:[Selenium With C# 基础教程] Lesson


下一篇:HTML(四)表格