Deliberately Bringing Up the Windows UAC Dialog ("Do you trust this program?")

I want to be able to run a script and have Windows' "Allow this program to make changes?" thing pop up. Like this:
1622693947735.png

My findings thus far:
* It's called "UAC," or "User Account Control." It's triggered by a program wanting to run as administrator — so that's what I need to make happen.
* Ruby does indeed have the ability, but it uses "win32ole," which isn't included in RGSS. The former is shown here: https://stackoverflow.com/questions/8268154/run-ruby-script-in-elevated-mode/27954953 and the latter is shown here: https://forums.rpgmakerweb.com/inde...uby-does-the-following-idea-make-sense.21574/
* If I'm not mistaken, I could do system(<something>, cmd.exe, and run a batch file that gets the job done. I assume there's a batch script in existence that would do what I want, but even if there were, I'm worried about it getting intercepted by security. I also don't want a CMD window visible in the background, although I'd be willing to sacrifice that if the rest of it could be made to work.
* I could also switch to MV (although I've never used it before) if being able to work with JavaScript instead of rgss would solve the problem. But right now, I'm stumped.
ShellExecute can also be invoked via win32api. You don't need win32ole:
Ruby:
shellexecute = Win32API.new('shell32', 'ShellExecuteA', 'IPPPPI', 'I')
shellexecute.call(0, 'runas', 'calc.exe', nil, nil, 1)
ShellExecute can also be invoked via win32api. You don't need win32ole:
Ruby:
shellexecute = Win32API.new('shell32', 'ShellExecuteA', 'IPPPPI', 'I')
shellexecute.call(0, 'runas', 'calc.exe', nil, nil, 1)
Spectacular, thank you very much!
Posting the rest of my solution here in case anyone needs it:
I wanted an executable that didn't do anything, and for its name to show in the UAC prompt. I also wanted it to be stored in the game directory, so it'd always have it on hand.
By default, the command above runs executables in the System32 folder. I found out about rundll32.exe, which does nothing when you simply click on it — it expects arguments, and ends without a fuss when it doesn't get them. I then copy-pasted rundll32.exe into my game directory, renamed it "TRUST.exe," and used the following code in an event script to run it as an admin from the directory:
Code:
shellexecute = Win32API.new('shell32', 'ShellExecuteA', 'IPPPPI', 'I')
path = File.expand_path(File.dirname(__FILE__))+"/"
puts path
shellexecute.call(0, 'runas', path+'TRUST.exe', nil, nil, 1)
Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/deliberately-bringing-up-the-windows-uac-dialog-do-you-trust-this-program.137100/