Code: Select all
if (Toggle) {
Menu, Tray, Icon, %A_ScriptDir%/speaker.png,,1
}
else {
Menu, Tray, Icon, %A_ScriptDir%/headphones.png,,1
}
return
I have a shortcut in my start up programs directory: %AppData%\Roaming\Microsoft\Windows\Start Menu\Programs\Startup, and it is able to toggle the tray icon successfully after logging into Windows.
Problem:
My problem is that using Task Scheduler to start up the script doesn't allow me to toggle the Tray Icon. I know the script is working because the other parts of the script are functional.
Running the script manually via the Task Scheduler GUI works just fine.
Restarting the computer and logging in does NOT work.
Signing out and signing back in does NOT work.
The reason I'm using Task Scheduler is for admin privileges.
Task Scheduler settings:
Trigger: At log on of any user
Actions: Start a program <my script>
Run with highest privileges.
Anyone have any thoughts on what I could be doing wrong?
Thanks in advance for the help!