03-15-2020 12:32 PM
After a long search, I have found a way to end processes that Cortana can respond to. This fix was originally posted on Youtube by Rahul B ttps://www.youtube.com/watch?v=q5m4Bm7EWDo&t=14s it involves writing a Javascript and creating a shortcut that you put into the Windows startup folder. Here is a script that closes firefox.
Option Explicit
Dim objWMIService, objProcess, colProcess
Dim strComputer, strProcessKill
strComputer = "."
strProcessKill = "'firefox.exe'"
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
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.
Thanks