using java to create end processes that work with Cortana

%3CLINGO-SUB%20id%3D%22lingo-sub-1229649%22%20slang%3D%22en-US%22%3Eusing%20java%20to%20create%20end%20processes%20that%20work%20with%20Cortana%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1229649%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3EAfter%20a%20long%20search%2C%20I%20have%20found%20a%20way%20to%20end%20processes%20that%20Cortana%20can%20respond%20to.%20This%20fix%20was%20originally%20posted%20on%20Youtube%20by%20Rahul%20B%20ttps%3A%2F%2F%3CA%20href%3D%22http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dq5m4Bm7EWDo%26amp%3Bt%3D14s%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ewww.youtube.com%2Fwatch%3Fv%3Dq5m4Bm7EWDo%26amp%3Bt%3D14s%3C%2FA%3E%20it%20involves%20writing%20a%20Javascript%20and%20creating%20a%20shortcut%20that%20you%20put%20into%20the%20Windows%20startup%20folder.%20Here%20is%20a%20script%20that%20closes%20firefox.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EOption%20Explicit%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EDim%20objWMIService%2C%20objProcess%2C%20colProcess%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EDim%20strComputer%2C%20strProcessKill%20%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EstrComputer%20%3D%20%22.%22%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EstrProcessKill%20%3D%20%22'firefox.exe'%22%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ESet%20objWMIService%20%3D%20GetObject(%22winmgmts%3A%22%20_%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26amp%3B%20%22%7BimpersonationLevel%3Dimpersonate%7D!%5C%5C%22%20_%20%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E%26amp%3B%20strComputer%20%26amp%3B%20%22%5Croot%5Ccimv2%22)%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3ESet%20colProcess%20%3D%20objWMIService.ExecQuery%20_%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3E(%22Select%20*%20from%20Win32_Process%20Where%20Name%20%3D%20%22%20%26amp%3B%20strProcessKill%20)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EFor%20Each%20objProcess%20in%20colProcess%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EobjProcess.Terminate()%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3ENext%20%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EWScript.Quit%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EIt%20works%20as%20a%20stand-alone%20program%20and%20a%20Cortana%20request%20%22Hey%20Cortana%2C%20Open%20Close%20Firefox%22.%20There%20are%202%20problems%20that%20crop%20up%20when%20you%20use%20that%20Cortana%20call.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E1.%20Cortana%20generates%20a%20request%20to%20either%20use%20%22Fiefox.exe%22%20or%20the%20shortcut%20%22Close%20Firefox.vbs%22.%20I%20can't%20get%20Cortana%20to%20automatically%20pick%20the%20one%20that%20closes%20Firefox.%20I%20thought%20renaming%20the%20shortcut%20something%20else%20would%20solve%20the%20problem%20but%20then%20the%20%22Open%2C%20Close%20Firefox%22%20would%20no%20longer%20work.%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3E2.%20After%20successfully%20closing%20Firefox%20an%20error%20popped%20up%20saying%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Close%20Firefox%20Run%20time%20error.JPG%22%20style%3D%22width%3A%20531px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F177043iD8A64563E317A15A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Close%20Firefox%20Run%20time%20error.JPG%22%20alt%3D%22Close%20Firefox%20Run%20time%20error.JPG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EI%20hope%20that%20someone%20can%20help%20me%20correct%20these%20problems%20or%20explain%20why%20they%20can't%20be%20solved.%20I%20hope%20these%20problems%20can%20be%20fixed%20because%20opening%20up%20Cortana%20can%20add%20a%20lot%20of%20functionality%20to%20Cortana.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

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

Close Firefox Run time error.JPG

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

 

make vbscripts and place their shortcuts in right place and enjoy.THE VBSCRIPT TO CLOSE APPS WORKING IN CREATORS EDITION OF WINDOWS 10PROCESS KILL METHODOpti...
0 Replies