Michiel Posted December 15, 2014 Share Posted December 15, 2014 Quick question: if I Run() an application which requires administrator, Run() fails with @error set to 1. When I do the same, but with #RequireAdmin at the top of my script, it works. When I start the application by clicking on it in Explorer, it gives me the UAC prompt and works. Why won't the application give me the UAC prompt if I run it with Run() and @SW_MAXIMIZE in the show_flag parameter? Instead, it always fails with @error set to 1. Link to comment Share on other sites More sharing options...
TheSaint Posted December 15, 2014 Share Posted December 15, 2014 Been too long since I played with that stuff, and all my programming is done on WinXP. That said, have you tried the ShellExecute command? That may work in bringing up the UAC prompt? Believe it or not, I've never actually tried #RequireAdmin, so I just presume it only works if you are logged in as admin? The UAC prompt might appear if not Admin? Have you checked out the RunAs command? It works quite well, and allows some flexibility ... you can ask for a password, etc. Michiel 1 Make sure brain is in gear before opening mouth! Remember, what is not said, can be just as important as what is said. Spoiler What is the Secret Key? Life is like a Donut If I put effort into communication, I expect you to read properly & fully, or just not comment. Ignoring those who try to divert conversation with irrelevancies. If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it. I'm only big and bad, to those who have an over-active imagination. I may have the Artistic Liesense to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage) Link to comment Share on other sites More sharing options...
Danyfirex Posted December 15, 2014 Share Posted December 15, 2014 Use ShellExecute("the file", "", "", "runas") Saludos Michiel 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Michiel Posted December 15, 2014 Author Share Posted December 15, 2014 That worked; didn't even require "runas".. That said, have you tried the ShellExecute command? That may work in bringing up the UAC prompt? It did! TheSaint 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now