Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

SendKeys works with Logged on User but not prior

We have an interactive logon that you simply click "OK" on and then computers autologin. I can push Sendkeys using deploy's powershell after there is a logged on user and it works fine, but none of the "Run As" users work prior to that so I have to manually click "OK" with the mouse or press enter, or spacebar. Anyone know something else I can try?

$wsh = New-Object -ComObject WScript.Shell


$wsh.SendKeys('{ENTER}')
0

Comments

3 comments
Date Votes
  • As far as I know SendKeys will not run without a user logged in. I've never heard of it being used before a login.

    0
  • Maybe try using Autoit? I've heard it can run before a login using VBScript.

    https://www.autoitscript.com/site/autoit/

    0
  • Sysinternals autologon is an easy way to get past the logon screen, if that's the part that's giving you trouble.

    0