mr-es335 Posted August 1 Posted August 1 Good day, I hope that the day finds you well! Q1: May I ascertain where exactly where #RequireAdmin is to be placed within a script? Q2: How often is #RequireAdmin to be deployed? Thank you for your time...appreciated! mr-es335 Sentinel Music Studios
Developers Jos Posted August 1 Developers Posted August 1 3 hours ago, mr-es335 said: Q1: May I ascertain where exactly where #RequireAdmin is to be placed within a script? Somewhere at the top is preferable for clearity, but anywhere will work. 3 hours ago, mr-es335 said: Q2: How often is #RequireAdmin to be deployed? Not sure what that means but AutoIt simply restarts itself with elivated rights when encountered and no running as admin yet.... ergo: One time max if needed. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
mr-es335 Posted August 24 Author Posted August 24 Is that per script, or just once during a system boot? mr-es335 Sentinel Music Studios
argumentum Posted August 24 Posted August 24 1 hour ago, mr-es335 said: Is that per script, or just once during a system boot? On the script that you run. That script only. Will not work if in an #include. Every time you run it, it will ask for admin rights. System boot or not. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
InnI Posted August 25 Posted August 25 8 hours ago, argumentum said: Will not work if in an #include Strange. It works for me. 1.au3 #RequireAdmin ConsoleWrite("" & @CRLF) 2.au3 #include "1.au3" MsgBox(0, "", "IsAdmin : " & IsAdmin())
argumentum Posted August 25 Posted August 25 ...well, look at that !. I thought that it wouldn't. Thanks for the correction @InnI Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
argumentum Posted August 25 Posted August 25 ..just did the test myself. Better add only in the main script as otherwise the Wrapper that runs in SciTE is not gonna know and will not behave as expected. ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
ioa747 Posted August 25 Posted August 25 It is not working properly. #include "1.au3" for $i = 1 To 10 ConsoleWrite("$i=" & $i & @CRLF) Next MsgBox(0, "", "IsAdmin : " & IsAdmin()) I know that I know nothing
argumentum Posted August 25 Posted August 25 ..it is working properly, just not in SciTE. SciTE reads the script ( the main script ) and if #RequireAdmin is found, it does it's thing to send to the user level running SciTE, via IPC. AutoIt3, will read all the includes, do it's thing, and if #RequireAdmin is found ( after loading all the related files ) it will request a RunAs. The question is: who in their right mind would place #RequireAdmin in an include. And the answer is obvious. The other question is: if the answer is obvious, does it require a post to ask what it is obviously doing ? I just woke up to the "what if", due to this post, as I would never place a #RequireAdmin anywhere other than the main script because, why would anyone do that. 🤷♂️ ioa747 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
mr-es335 Posted August 25 Author Posted August 25 Hello, All of my scripts look as the following: ; ----------------------------------------------- #RequireAdmin ; ----------------------------------------------- #include <NameOfInlcude> ; ----------------------------------------------- Opt("MustDeclareVars", 1) ; ----------------------------------------------- NameOfFunction() ; ----------------------------------------------- Func NameOfFunction() EndFunc ;==>NameOfFunction ; ----------------------------------------------- Is this correct...or not? ioa747 1 mr-es335 Sentinel Music Studios
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