I love AutoHotkey (AHK) and use it to launch all of my apps using AHK Command Picker. In order to get around restrictions put in place by the Windows 8 UAC I require my AHK scripts to run as administrator. Now, whether running the script as admin or not, if I manually start my AHK script it is able to launch my ClickOnce apps. This is an example of how I am launching the ClickOnce app from AHK:
The problem I'm having occurs when I use the Task Scheduler to automatically start my AHK script when I log into Windows. When I do this, if I try and launch a ClickOnce app with my script then nothing happens. I can close the script and manually run the Scheduled Task to restart it, but it still won't work. If I then close the script and launch it manually (by double clicking my .ahk file), then everything works fine and I can launch my ClickOnce apps. If I then close the script again, and manually run the Scheduled Task to restart it again, then everything still works fine and I can launch my ClickOnce apps.
So the problem doesn't seem to be caused by the Task Scheduler launching the script, but that for some reason the script needs to be manually ran at least once first before it will be able to open ClickOnce apps.
I'm not sure what the difference is between me manually double clicking the .ahk file or by having a Scheduled Task launch it for me (the scheduled task is set to run as my user (which is an admin), and has "Run with highest privileges" checked). But for some reason me manually double clicking the file seems to change some setting so that the AHK script runs differently until the next time the PC is restarted. The one difference that I can think of is that in the Scheduled Task I have the "Start in (optional)" field set to the folder containing the AHK script (e.g. C:\SomeFolder), whereas when I manually run the .ahk file by double clicking it I don't know if this is set.
Any suggestions are greatly appreciated. Thanks.