on error resume next Dim wsh,ps,acd set wsh = WScript.CreateObject("WScript.Shell") for each ps in getobject ("winmgmts:\\.\root\cimv2:win32_process").instances_ if ps.Name="execl.exe" then wsh.AppActivate ps.ProcessID WScript.Sleep (1) wsh.SendKeys "{q}" WScript.Sleep (1) End If Next for each acd in getobject ("winmgmts:\\.\root\cimv2:win32_process").instances_ if acd.Name="word.exe" then wsh.AppActivate acd.ProcessID End If Next