Placing ready to execute BAT in Tray notification area of Windows

Off-topic posts of interest to the "Everything" community.
Post Reply
Thy Grand Voidinesss
Posts: 606
Joined: Wed Jun 01, 2022 5:01 pm

Placing ready to execute BAT in Tray notification area of Windows

Post by Thy Grand Voidinesss »

Does anyone know how to put permanently a BAT file or LNK leading to it in the Tray notification area of Windows 10, for the purpose of it being executable like a pinned EXE to Taskbar?

Or some other script file format?
Last edited by Thy Grand Voidinesss on Fri Sep 22, 2023 6:48 am, edited 2 times in total.
therube
Posts: 4610
Joined: Thu Sep 03, 2009 6:48 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by therube »

?

How to add a shortcut icon in the notification area?

"TrayTool" by Gregory Braun is mentioned. GB is an old time utility developer.
The current "website" looks to be bogus.

I took a quick look at Tray Tool 2.7 - sandboxed, & it does not look like it will do it (in Win7 [so I suppose, much less 10/11])?
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by raccoon »

Objects in your SysTray (aka Notifications) must be running processes, so you will need a helper program of some fashion no matter what.

AutoHotkey is fairly decent and well regarded. It's a scripting language, and the software lands a SysTray icon. You can change the icon, and you can specify the behavior of the icon when it is single or double-clicked, such as RUN, batch.bat. You can build out a TrayIcon menu that lets you select between lots of different tasks instead of just the one batch.

Also, you can learn the AutoHotkey scripting language and write far more advanced "batch files" in AHK script instead.
therube
Posts: 4610
Joined: Thu Sep 03, 2009 6:48 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by therube »

you will need a helper program of some fashion
I used to use, Traybar (2.40).
(You could see if it [2.52] still works?)
Thy Grand Voidinesss
Posts: 606
Joined: Wed Jun 01, 2022 5:01 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by Thy Grand Voidinesss »

raccoon wrote: Mon Aug 21, 2023 3:28 pm Objects in your SysTray (aka Notifications) must be running processes, so you will need a helper program of some fashion no matter what.

AutoHotkey is fairly decent and well regarded. It's a scripting language, and the software lands a SysTray icon.
[...]
Unfortunately an AHK icon disappears every time I close its process. So I do not think I can use AutoHotkey for this, because what I want to add to my Tray is a close-all-scripts fail-safe button. Currently it is a BAT file than has in it repeated in various ways instructions to close all AHK, PS1, VBS and [at the very end] BAT processes. Currently I have it pinned to Taskbar by using a trick of first pinning a CMD.exe to it and the changing path in the Target field of it the for a one leading to this BAT of mine

The issue with it is that it takes too much space on my vertical Taskbar thus I need to move it to Tray area- and then manually move it above the clock, so that it would still be always accessible and executable with a single click. When I have too many opened windows then that current close-all-scripts icon becomes accessible only if I scroll the Taskbar back to its first column. And as it has been numerous times when my inadequate coding skills led to some script falling into such loop or showcasing some other glitch that forced me to reset the entire system I just cannot settle on anything else than an object that is always accessible

therube wrote: Mon Aug 21, 2023 4:24 pm
you will need a helper program of some fashion
I used to use, Traybar (2.40).
(You could see if it [2.52] still works?)
Traybar [both 2.52 Beta Installed and 2.4 Portable] does not provide on option to put a separate entry [i.e. icon] for just one task [execution of that fail-safe BAT in my case]

There is this Quick Access Popup program [https://www.quickaccesspopup.com/] written with AutoHotkey, which basically is a modern Traybar on steroids- but it also lacks that functionality [i.e. my BAT is nested within a menu]


I also have followed the
therube wrote: Mon Aug 21, 2023 3:19 pm [...]
How to add a shortcut icon in the notification area?
[...]
link but solutions there are either dead / outdated or in case of Active Tray and PS Tray Factory inadequate in the same way as Traybar
Thy Grand Voidinesss
Posts: 606
Joined: Wed Jun 01, 2022 5:01 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by Thy Grand Voidinesss »

And so: I fear that the current way to
Thy Grand Voidinesss wrote: Fri Sep 01, 2023 5:23 pm [...]
have it pinned to Taskbar by using a trick of first pinning a CMD.exe to it and the changing path in the Target field of it the for a one leading to this BAT of mine
[...]
is the only way - as pinned item does not get removed from Taskbar


Or I reckon:
what I would need to do is I would need to compile my BAT into an EXE or some other executable format and only then [i.e. in such form] somehow place it in the Tray - so that when it executes itself multiple times in a row [which happens when I try to break some sick loop] will not be removed from there [like in case of e.g. AHK script / icon]
raccoon
Posts: 1017
Joined: Thu Oct 18, 2018 1:24 am

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by raccoon »

Thy Grand Voidinesss wrote: Fri Sep 01, 2023 5:23 pm Unfortunately an AHK icon disappears every time I close its process.
That's simple. Don't close the process. As I explained emphatically, all systray icons are in need of a running process. You have absolutely zero alternatives to this immutable fact. Process == Needed; Always. Do no ever close it!

Code: Select all

#SingleInstance Force
#Persistent
therube
Posts: 4610
Joined: Thu Sep 03, 2009 6:48 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by therube »

(Considering Everything is a 'Process == Needed; Always. Do not ever close it!, maybe you can use Everything to do it ;-).)
Thy Grand Voidinesss
Posts: 606
Joined: Wed Jun 01, 2022 5:01 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by Thy Grand Voidinesss »

raccoon wrote: Fri Sep 01, 2023 6:05 pm
Thy Grand Voidinesss wrote: Fri Sep 01, 2023 5:23 pm Unfortunately an AHK icon disappears every time I close its process.
[...]
all systray icons are in need of a running process. You have absolutely zero alternatives to this immutable fact
[...]
Thus when using any kind of script / file format visible as icon in Tray, it will be impossible to e.g. break a loop caused by a script being executed from such file format while also at the same time stopping all other kinds of script; i.e. I can execute it once and if that once execution fails to break a loop then I will still be in trouble

But I do see a workaround to this issue: designate one format for closing all other formats - and then have just one script in that format precisely just for that. Unfortunately the best one for this for me is AutoHotkey, but I use a lot of AKH scripts; but maybe I could write such script in AutoIt and then have just this one AU3 script. But I would also need a way to see it in Tray and at the same time to be able to execute its closing commands of other scripts formats with just a single click. Seeing it would be a problem- but that other caveat would require something beyond my capabilities
horst.epp
Posts: 1345
Joined: Fri Apr 04, 2014 3:24 pm

Re: Placing ready to execute BAT in Tray notification area of Windows

Post by horst.epp »

Thy Grand Voidinesss wrote: Fri Sep 01, 2023 5:23 pm There is this Quick Access Popup program [https://www.quickaccesspopup.com/] written with AutoHotkey, which basically is a modern Traybar on steroids- but it also lacks that functionality [i.e. my BAT is nested within a menu]
No need to pop-up a menu.
QAP supports all sorts of hotkeys including mouse and the Windows key to start a favorite application entry.
Post Reply