KnowBrainer Speech Recognition
Decrease font size
Increase font size
Topic Title: Autohotkey Script to Close Dragon without Saving the User Profile and Restarts
Topic Summary:
Created On: 12/10/2019 12:39 PM
Status: Post and Reply
Linear : Threading : Single : Branch
 12/11/2019 07:13 PM
User is offline View Users Profile Print this message

Author Icon
Edgar
Top-Tier Member

Posts: 806
Joined: 04/03/2009

With recent changes to KnowBrainer the batch file had to be "run as administrator" (at least on my Windows 10 machine). I started exploring workarounds. One version is to create a shortcut to the batch file on the Desktop and change the shortcut’s property so that it runs as administrator. I did not have great success with this although it sometimes work. I finally wrote a tiny C# application in Visual Studio 2017:

using System.Diagnostics;

using System.Threading;

 

namespace KillDragon {

   class Program {

      static void Main(string[] args) {       // PIDs  

         EndProcessTree("KBPro.exe");       //5264  

         Thread.Sleep(2000);//sleep 2 seconds

         EndProcessTree("ProcHandler.exe");  //9864

         //EndProcessTree("KBProcHandler.exe");

         //EndProcessTree("pcbvWndProc1928.exe");

         Thread.Sleep(1000);//sleep 1 second

         EndProcessTree("dragonbar.exe");   //18008

         EndProcessTree("dgnuiasvr.exe");   //12644

         EndProcessTree("dgnuiasvr_x64.exe");  //700

         EndProcessTree("dgnsvc.exe");      //10500

         EndProcessTree("natspeak.exe");     //18088    

         //EndProcessTree("formfiller.exe");      

         //EndProcessTree("dgnria_nmhost.exe");

         //EndProcessTree("nsbrowse.exe");

         //the commented out trees are from older versions and helpers

      }

 

      private static void EndProcessTree(string imageName) {

         Process.Start(new ProcessStartInfo {

            FileName = "taskkill",

            Arguments = $"/im {imageName} /f /t",

            CreateNoWindow = true,

            UseShellExecute = false

         }).WaitForExit();

      }   

   }

 

}

As with the batch file it has a tendency to leave the icons in the tray (a minor irritation but no impediment to restarting KnowBrainer and/or Dragon). I've experimented around with solutions for clearing these icons from the tray and I suspect that I am fairly close to a solution but the visual irritation is not enough to spur me on to finding a solution.


-------------------------

-Edgar
DPI 15.3, 64-bit Windows 10 Pro, OpenOffice & Word 365, Norton Security, Shure X2U XLR to USB mic adapter with Audio Technica DB135 vocal mic, Asus X299-Deluxe Prime, Intel Core i9-7940X (14 core, 4.3 GHz overclocked to 4.9 GHz), G.SKILL TridentZ Series 64GB (4 x 16GB) DDR4 3333 (PC4 26600) F4-3333C16Q-64GTZ, NVIDIA GIGABYTE GeForce GTX 1060 GV-N1060G1 GAMING-6GD REV 2.0 6GB graphics card

Statistics
31655 users are registered to the KnowBrainer Speech Recognition forum.
There are currently 0 users logged in.
The most users ever online was 4473 on 07/17/2020 at 10:00 AM.
There are currently 665 guests browsing this forum, which makes a total of 665 users using this forum.

FuseTalk Standard Edition v4.0 - © 1999-2020 FuseTalk™ Inc. All rights reserved.