VBS 自動打開軟件 點擊 軟件 關閉進程方法!
Dim WshShell, QQPath QQPath="C:\TM ACv6\TMAC.exe" '需要打開的軟件路徑 Set WshShell=WScript.CreateObject("WScript.Shell") path = Chr(34) & QQPath & Chr(34) '去除路徑空格 WshShell.Run path,1 WScript.Sleep 10000 '等待1秒鍾
WshShell.sendkeys "%{ESC}" '選中當前路徑的界面 WshShell.AppActivate "Technitium MAC Address Changer v6 - by Shreyas Zare" '需要激活的軟件框標題名稱 WshShell.sendkeys "{enter}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{ENTER}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{TAB}" WshShell.SendKeys "{ENTER}" WScript.Sleep 3000 WshShell.SendKeys "{ENTER}" WScript.Sleep 3000 CreateObject("WScript.Shell").Run "taskkill /f /im TMAC.exe", 0 'TMAC.exe 為需要關閉的進程名稱