當電腦閒置後關閉指定的ERP程式

MSFT相關
回覆文章
yehlu
Site Admin
文章: 3244
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

當電腦閒置後關閉指定的ERP程式

文章 yehlu »

http://ithelp.ithome.com.tw/question/10 ... g=nl.daily

http://www.autoitscript.com/site/autoit/downloads/

代碼: 選擇全部

Opt("TrayIconHide",1) ;隱藏 AutoIt 常駐圖示
#include <Timers.au3>;指定時間檔案腳本
 While 1;迴圈
Sleep (2000);暫停2秒
$_time= _Timer_GetIdleTime();鍵盤滑鼠閒置時間
If $_time <600000 Then;小於10分鐘
	;ToolTip ("系统空闲:" & $_time/1000 & "秒") ;在螢幕的任意位置顯示一個工具提示
ElseIf $_time >601000 Then;大於10分鐘1秒
	WinActivate("GoldenTop", "");指定活動視窗
	WinSetOnTop("GoldenTop", "",1);指定視窗至頂層
If WinExists("GoldenTop") Then;檢查視窗是否存在
     WinClose("GoldenTop", "");關閉指定視窗
	 Sleep (500);暫停0.5秒
	 Send("!Y");ALT+Y關掉訊息
	Sleep (500);暫停0.5秒
	Send("!Y");ALT+Y關掉訊息
	Sleep (500);暫停0.5秒
	Send("!Y");ALT+Y離開
EndIf
EndIf
WEnd

代碼: 選擇全部

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"WinClose"="c:\\WinClose.exe"
回覆文章

回到「Microsoft」