How to kill systray icons when using TASKKILL to stop NetWorx

Started by Praxis

How to kill systray icons when using TASKKILL to stop NetWorx   25 August 2015, 04:54

Hi Andrew,

I'll list the .bat file which I have scheduled to run daily. It manages to 'kill' the 3 processes and children but their icons remain in systray. So an icon is not a child process I guess. This causes a problem when I start the 3 instances again, multiple icons exist in "Customize notification icons", some from the 'old' processes and some from the 'new', and these somehow conflict and therefore none of them appear.

Is there a way that I can also 'kill' the icons when I use "TASKKILL" to 'kill' the 3 instances/processes?

As it says in the .bat file, there's a 'pause' so that I can run my cursor over the systray which deletes the icons, then when the processes are started, their icons appear and work. But I'd like to run this without manual intervention.

Thanks,
J

The NWdaily.bat file:
cd c:\
echo on

REM Delete all records in Networx table "application".
REM (sqlite3 can't delete records if networx.exe is active and
REM networx.exe can't Start if either networx1.exe or networx2.exe are active
REM so kill all three, run sqlite3 and then Start all three)
REM /FI is a filter to find all tasks that have an IMAGENAME = "networx*"
REM /IM=image(program) name /F=Force /T=including all child processes

    taskkill /FI "IMAGENAME eq networx*"  /IM networx*  /T /F

REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REM xx PAUSE to pass cursor over icons in systray to remove them, xx
REM xx else, if not done, there are multiple icons = bad news.    xx
REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Pause

REM --------------- can't run sqlite3 from G: ----------------
cd   C:\sqlite3_run

sqlite3.exe "G:\Portable\NetWorx\StatsI\networx.db" "DELETE FROM application"

cd   C:\
    start /D "C:\Program Files\Networx"                   networx.exe
    start /D "G:\Portable\NetWorx\networx1"            networx1.exe
    start /D "G:\Portable\NetWorx\networx2"            networx2.exe

REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
REM Pause to verify that icons are visible again
REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Pause
SoftPerfect Support forum - Andrew avatar image

Re: How to kill systray icons when using TASKKILL to stop NetWorx   25 August 2015, 15:43

Well, you can try restarting the shell using a couple of lines from this file or try not to use /F with taskkill, this may help shutdown NetWorx gracefully and remove its icon.

Re: How to kill systray icons when using TASKKILL to stop NetWorx   25 August 2015, 23:57

I first tried eliminating the "/F" but that gave a popup error: "Cannot use Ctrl + Alt + G as a hotkey: System Error. Code 1409. Hot key is already registered"

So then I copied the contents of the file "ResetIconCache.bat" (to: stop explorer, delete 2 registry keys and start explorer) into my .bat file and then I modified the TASKKILL line to get all explorer processes:
taskkill /FI "IMAGENAME eq explorer*" /im explorer* /f

The only problem that occurred was that not all icons were restored. A reboot fixes this and the missing icons are no longer missing.

Thanks, smile
J

Reply to this topic

Sometimes you can find a solution faster if you try the forum search, have a look at the knowledge base, or check the software user manual to see if your question has already been answered.

Our forum rules are simple:

  • Be polite.
  • Do not spam.
  • Write in English. If possible, check your spelling and grammar.

Author:

Email:

Subject

A brief and informative title for your message, approximately 4–8 words:

     

Spam prevention: please enter the following code in the input field below.

 ********  **     **  **     **  **      **   *******  
 **         **   **   **     **  **  **  **  **     ** 
 **          ** **    **     **  **  **  **  **     ** 
 ******       ***     **     **  **  **  **   ******** 
 **          ** **    **     **  **  **  **         ** 
 **         **   **   **     **  **  **  **  **     ** 
 **        **     **   *******    ***  ***    *******  

Message: