Jump to content

Recommended Posts

Posted

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!

 

  • Developers
Posted
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.
  :)

  • 4 weeks later...
Posted

..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. 🤷‍♂️

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...