Option Explicit Dim objWMIService, objProcess, colProcess Dim strComputer, strProcessKill strComputer = "." strProcessKill = "'firefox.exe'"
Set colProcess = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = " & strProcessKill ) For Each objProcess in colProcess objProcess.Terminate() Next WScript.Quit
It works as a stand-alone program and a Cortana request "Hey Cortana, Open Close Firefox". There are 2 problems that crop up when you use that Cortana call.
1. Cortana generates a request to either use "Fiefox.exe" or the shortcut "Close Firefox.vbs". I can't get Cortana to automatically pick the one that closes Firefox. I thought renaming the shortcut something else would solve the problem but then the "Open, Close Firefox" would no longer work.
2. After successfully closing Firefox an error popped up saying
I hope that someone can help me correct these problems or explain why they can't be solved. I hope these problems can be fixed because opening up Cortana can add a lot of functionality to Cortana.