Deye Posted April 8, 2015 Posted April 8, 2015 quoting the help file about #RequireAdmin: "In case system doesn't have elevation mechanism (e.g. disabled UAC) new process will run under the same user as the original." just to be clear about correctnone-correct cases regarding #RequireAdmin: 1. if the user is running under a disabled UAC, he wont be able to run as another user with admin rights ? 2. using #RequireAdmin and a disabled UAC wont give any message that user hasn't got admin privileges to run.., but then the script continue's (the script needs a routine to figure this out) ? thanks
JohnOne Posted April 8, 2015 Posted April 8, 2015 quoting the help file about #RequireAdmin: "In case system doesn't have elevation mechanism (e.g. disabled UAC) new process will run under the same user as the original." just to be clear about correctnone-correct cases regarding #RequireAdmin: 1. if the user is running under a disabled UAC, he wont be able to run as another user with admin rights ? 2. using #RequireAdmin and a disabled UAC wont give any message that user hasn't got admin privileges to run.., but then the script continue's (the script needs a routine to figure this out) ? thanks 1. false. 2.part1 true. 2.part2 don't understand. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Deye Posted April 8, 2015 Author Posted April 8, 2015 JohnOne let me try and rephrase the second part since there is no (or - might be) built-in command to check if UAC is disabled when using #RequireAdmin then the script needs a special routine added to check if it can run as elevated ..(as it necessarily need to be.. - elevated) thanks
JohnOne Posted April 8, 2015 Posted April 8, 2015 #RequireAdmin does not care if UAC is enabled or disabled, it just requests of the operating system, administrator privileges. Beyond that, the OS takes care if. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
spudw2k Posted April 9, 2015 Posted April 9, 2015 Without being able to test UAC being disabled, I believe a script with #RequireAdmin will simply not run if it cannot be elevated. You could always verify this with IsAdmin() like in the help file example for #RequireAdmin. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF
JohnOne Posted April 9, 2015 Posted April 9, 2015 If you are looking to see if script was run with admin, there are some good examples on the forum. And here's a small one I just found in a christmas cracker. ;#RequireAdmin MsgBox(0,0, _RunningAsAdmin()) Func _RunningAsAdmin() $tmp = @ProgramFilesDir & "\" & @ScriptName & ".tmp" $Success = FileWrite($tmp, "") FileDelete($tmp) Return $Success EndFunc ;==>_RunningAsAdmin AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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