Am 07.06.2023 um 22:18 schrieb et99:
>
> It sounds like you need to run this before the user is
> logged in. I'm not sure if this would work before
> you're even logged in, however,
>
>
https://windowsloop.com/how-to-run-a-program-as-administrator-without-prompt/
>
> I've used this described procedure with the task
> scheduler to run a tcl script at admin privs to run a
> program w/o the prompt and then using twapi find its
> window and send it mouse clicks.
>
> In the task scheduler, I see one can set in the
> general tab, "run whether user is logged on or not"
> And there's also a checkbox "run with *highest*
> privileges". Not sure how high that really is though.
>
> Then in the triggers tab, with new... (to create a new
> trigger) at the top it says "begin the task", one can
> choose "at logon" or even "at startup".
>
> I've not tried this, as the above page only discusses
> how to setup a task that you run from a shortcut using
> the schtasks.exe program.
>
> But perhaps you can adapt it to run prior to logon.
> Then maybe you don't need to use the schtasks.exe
> directly, but have it run for you at logon or startup.
> If it runs with highest privs, maybe that's good enough.
>
> I've only used this on win 10 however, not win 11.
Thanks a lot for this valuable contribution.
I appreciate, that you read this long post and thinks on it.
Did you do mouse-clicks on the unlock login screen (if the user has
locked the screen)? Did that work? If YES, I am interested, how the
application is done. Is the exe signed? Is it at c:\program files..?
What is the manifest?
What I tested:
- desktop starkit with user privileges -> can send keypresses to any
other program of the user. If the user locks the screen and activates
the password entry, it can not send to this entry.
- desktop starkit with admin privileges -> can send keypresses to other
admin programs and to user programs. If the user locks the screen and
activates the password entry, it can not send to this entry.
- Windows service starkit with system user: can send keypress to any
other program, but not to initial login password field, nor to unlock
screen password field.
The corresponding system calls succeed when keystrokes are sent to the
login screen, but there is no output. I suppose, the following phrase
from the SendInput function help page gives insight to that:
"This function fails when it is blocked by UIPI. Note that neither
GetLastError nor the return value will indicate the failure was caused
by UIPI blocking."
So, I suppose, your proposition was already tested.
Do you agree with this analysis ?
Thank you again, I appreciate !
Take care,
Harald