RamonUnch/AltSnap

Auto start on boot with elevated privileges, how to eliminate the UAC prompt ?

Closed this issue · 4 comments

Hi,

I would like alt-snap to be able to interact with elevated windows.

So I set it to auto start with elevated privileges.

As alt-snap indicates, this does create a UAC prompt on every boot.
Alt-snap even suggests starting it from a task scheduler as a suggestion.

Do we have a clear method for starting alt-snap with elevated privileges at boot without an extra UAC prompt on every reboot ?

I have not tried this but there is a command to create a scheduled task, to run at boot, with elevated privileges

schtasks /create /f /tn "RunAltSnap" /tr "C:\Path\To\AltSnap.exe" /sc onlogon /rl highest

Here is the meaning of those arguments as per schtasks /create /?

/F                 Forcefully creates the task and suppresses warnings if
                   the specified task already exists.

/TN   taskname     Specifies the string in the form of path\name
                   which uniquely identifies this scheduled task.

/TR   taskrun      Specifies the path and file name of the program to be
                   run at the scheduled time.
                   Example: C:\windows\system32\calc.exe

/SC   schedule     Specifies the schedule frequency.
                   Valid schedule types: MINUTE, HOURLY, DAILY, WEEKLY,
                   MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE, ONEVENT.

/RL   level        Sets the Run Level for the job. Valid values are
                   LIMITED and HIGHEST. The default is LIMITED.

It is possible to check if the task exists with

schtasks /query /tn "RunAltSnap" /fo LIST

/TN   taskname       Specifies the task path\name for which
                     to retrieve the information, else all of them.
/FO   format         Specifies the format for the output.
                     Valid values: TABLE, LIST, CSV.

And it is possible to delete the task with

schtasks /delete /tn "RunAltSnap" /f

There is also an AltSnap.xml file in the installation directory to help users to setup the Scheduled task.
Because Scheduled tasks are invisible in the task manager's startup list, I do not put AltSnap there by default, Also many users will not use it elevated anyway.

I will Add the command line options in the wiki, and to the readme file, this will be helpful to some users indeed.

Referenced in the README FIRST issue, so I close it.