Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: VBscript to add program to notification area?

10 May 2011   #1

Windows 7 64 Enterprise
VBscript to add program to notification area?

I'm creating an image which must build in an unattended fashion. The client (the end user of the resulting image) wants to have the icon for one of the included programs included in the notification area. While this CAN be done manually, because of the required build process, I do not have the option of manually adding the program to the notification area; I will need to automate this via a script or other method.

I've found VB scripts for adding ("pinning") programs to the Start Menu and Taskbar, but not for the Notification Area.

EDIT: To clarify further, I want to change the Behavior for this program from "Only show notifications" to "Show icon and notifications", but do so from a command line or script.

Can anyone point me in the right direction to getting this automated?


My System SpecsSystem Spec

10 May 2011   #2

Windows 8.1 ; Windows 7 x86 (Dec2008-Jan2013)

That is a very challenging task.

Those things are kept decoded and in binary format.
HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify
"PastIconsStream" = stores the icons data
"IconStreams" = stores the program path, caption and tip

So, technically, if they are coded the same way across all computers, and you would know how your program adds and codes itself there, during installation you could dump both values from user's computer, then add your data and write new complex strings (old+yours) back in the registry.

Or you could try something like Autoit script to do it semi-manually (but user will see what is going on).

Or you could force them all to Show icon and notification (Option two here), but that would not be fair to the end user.

I do not see an easy elegant solution here.
My System SpecsSystem Spec
07 Sep 2012   #3


I have solved this issue finally. I spent 6 hours looking for this answer today .... i'll post the full solution tomorrow as its time to head home now.
My System SpecsSystem Spec

10 Sep 2012   #4


So here's my solution ....

2 files are required for this. A .bat file and a .ps1 file.

Take the powershell code from this website, which i DID NOT write, so i wont take credit for (read the whole page, it explains it in full detail) and paste that code in the .ps1 file. Thats all you need to do with this file.

Windows 7 Notification Area Automation – Falling Back Down the Binary Registry Rabbit Hole Xtreme Deployment

The second file is a .bat file, where you'll put the commands to run the .ps1 file. The powershell script takes 2 inputs, the first is the name of the notification icon you want to make the change to, and the second is which of the three available options you want to set.

  • 0 = only show notifications
  • 1 = hide icon and notifications
  • 2 = show icon and notifications

For my specific application of this solution, I wanted to set the Zenworks Notification Icon to level 2 so its always in the notification area for users to click on since there is a lot of easy to access information available from there. IP address, system name ... things they need to get support from our helpdesk.

so my .bat file looks like this:

taskkill /im explorer.exe /f
powershell Set-ExecutionPolicy Unrestricted
powershell .\ZNIexeEdit.ps1 ZenNotifyIcon.exe 2
powershell Set-ExecutionPolicy Restricted

you kill windows explorer, which is necessary for the script to change the registry entry that controls the notification icons

HKCU\Software\Classes\Local Settings\Microsoft\Windows\CurrentVersion\TrayNotify\IconStreams

then you have to set the rights level of powershell

then you call your script with your 2 parameters

then you set the rights level of powershell back to its original state cuz you dont wanna leave it unrestricted

then you restart explorer

all done. both the .bat and the .ps1 need to be in the same directory, i used them right out of C:\ and you just need to launch the .bat file. so you have 2 small files that are easy to distribute through whatever means.

it is important that the actual user of the machine be logged in at the time the .bat file is executed.
My System SpecsSystem Spec

 VBscript to add program to notification area?

Thread Tools

Similar help and support threads for2: VBscript to add program to notification area?
Thread Forum
How to add a program to notification area of taskbar General Discussion
Solved Notification area customization reset when program not running General Discussion
How to Add Program Icons to the Notification Area? Customization
Notification Area Customization
Notification area Performance & Maintenance
Notification Area General Discussion
Uninstalled Program Remains on Notification Area List General Discussion

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 02:55 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33