VBS 自动打开软件

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  为需要关闭的进程名称

 

posted @ 2018-06-11 20:51  llxpbbs  阅读(5493)  评论(0编辑  收藏  举报