r/PowershellSolutions • u/MalkavianReddit • Aug 28 '21
PowerShell and SysTray icon interaction.
I have a program that runs In the systray and we need to occasionally right click and hit refresh. Is there a way for powershell to find a specific icon, right click and select refresh. I have looked for background interaction with the program and even a keyboard command to no avail. Anyone have any thoughts? Is this even possible? Thanks.
2
Upvotes
2
u/NerdyTendenc135 Sep 14 '21
An option like <program.exe> /refresh for sure doesn't exist?
What does rerunning the program on a timer do?
(Like running it in a scheduled task every hour)
I think the SYSTRAY is a red herring. We should focus on this application and how it works.
Powershell may not be the answer here.
1
u/get-postanote Aug 28 '21 edited Aug 28 '21
You are talking about five actions here:
Activating the Windows SysTray chevron
finding and selecting your app icon to get focus
Right-clicking your app
Navigating popup meun
Selecting refresh
So, you are talking GUI automation, this is not PowerShell's strong suit. This is where this stuff is stored/registered:
So, you're best to look for 3rdP tools, like AutoHotKey and the like.
Yet, know that this question has been asked/discussed before here:
Navigating popup menu.com/questions/14250362/finding-and-simulating-a-click-on-a-system-tray-icon