Is there a way to run a .cmd file when a specific program is closed?
问题 I want the program GOPHER.exe to close when I close Netflix. I already have it set so that when I open Netflix, GOPHER also opens. Right now the command in the .cmd file to close GOPHER is "TASKKILL /IM gopher.exe". I want it to run when I close Netflix. 回答1: This monitors for programs exiting using WMI (MS's implementation of WBEM). Here it checks for Notepad exiting and restarts it. Set WshShell = WScript.CreateObject("WScript.Shell") Set objWMIService = GetObject("winmgmts:\\.\root\CIMV2")