wslh 0 Posted November 17, 2010 (edited) Hi, I would like to run my AutoIt script in two scenarios with different behaviour: i) With #RequireAdmin ii) Without #RequireAdmin if user can't escalate privileges. a) How can I do that since the RequireAdmin affects the .exe manifest? And also how can I verify if the user can escalate privileges? I was thinking in packing two exes for (a), but don't know how to do (. There is other way to accomplish it? Thanks, wslh Edited November 17, 2010 by wslh Share this post Link to post Share on other sites
JohnOne 1,603 Posted November 17, 2010 IsAdmin() maybe. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
wslh 0 Posted November 17, 2010 IsAdmin() maybe.I don't think so. If you haven't escalated privileges it returns false. And if the script was compiled with #RequireAdmin it can't run without Admin privileges. Share this post Link to post Share on other sites
JohnOne 1,603 Posted November 17, 2010 (edited) I had it in my head that this would work. If IsAdmin() Then #RequireAdmin EndIf While 1 sleep(20) WEnd Of course though, it does not. Edited November 17, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Share this post Link to post Share on other sites
aef03 0 Posted December 21, 2010 I had it in my head that this would work. If IsAdmin() Then #RequireAdmin EndIf While 1 sleep(20) WEnd Of course though, it does not. The operating system already handles this with the manifest level "highestAvailable" - so use this in your script: #AutoIt3Wrapper_res_requestedExecutionLevel=highestAvailable It will prompt for admin if the user can give it, otherwise it will run as a regular user. Will also selectively display the shield. (#RequireAdmin relaunches as admin, so it does not display the shield). Share this post Link to post Share on other sites