定时关机脚本

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的进程。

你可能感兴趣的:(脚本)