Reputation: 1
I am writing a script which will allow PowerShell to run in admin mode but when I run Set-ExecutionPolicy Bypass, Windows displays a popup and I use my left arrow key to move to the yes button and press enter.
The problem I am facing is that it does not move to the left or press enter when I run the script as follows.
RunWait PowerShell.exe -ExecutionPolicy Bypass -NoExit -Command "C:\Users\%A_UserName%\Desktop\Script.ps1";
Send {Left}
Sleep, 5000
Send {Enter}
I am expecting it to actually move to the OK button on the left and press enter but nothing actually happens.
Upvotes: 0
Views: 111
Reputation: 10568
Upvotes: 1