how to simulate to click "YES" button in a windows popup raised by .exe by .bat or powershell ?

Yonglong YL44 Wang 61 Reputation points
2023-01-05T08:54:28.723+00:00

in my bat scripts, i want to invoke a .exe like this

c:\windows\setup\scripts\aa.exe

a popup will be up for this .exe like this,

276387-popup.jpg

i want to the script to click " YES " button, then the .exe will be run successfully.

i tried to use :
echo Y | c:\windows\setup\scripts\aa.exe

but it does not work.

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anonymous
    2023-01-06T09:57:35.267+00:00

    Hi,

    Unfortunately, there is no way to simulate clicking the "YES" button in the User Account Control. You cannot bypass the UAC prompt unless you disable it.

    Best Regards,
    Ian Xue


    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.