fby Posted June 22, 2021 Share Posted June 22, 2021 Dear All, I have simple script that can running well on windows 10 with login local administrator, I have tried run this script on login local user but can't run because need local administrator credential, what script to add user and password local administrator? #RequireAdmin Run(@ScriptDir & '\setup.exe') AutoItSetOption('MouseCoordMode', 0) WinWait('Application') WinActivate('Application') MouseClick('primary' ,374, 374, 1, 0) Sleep(1000) MouseClick('primary' ,187, 321, 1, 0) Sleep(1000) MouseClick('primary' ,372, 374, 1, 0) Sleep(1000) MouseClick('primary' ,165, 120, 1, 0) Sleep(1000) MouseClick('primary' ,170, 254, 1, 0) Sleep(1000) MouseClick('primary' ,388, 372, 1, 0) Sleep(1000) MouseClick('primary' ,360, 378, 1, 0) Sleep(30000) MouseClick('primary' ,375, 376, 1, 0) Sleep(1000) MouseClick('primary' ,373, 375, 1, 0) Best Regards, Link to comment Share on other sites More sharing options...
Developers Jos Posted June 22, 2021 Developers Share Posted June 22, 2021 Moved to the appropriate forum. Moderation Team 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. Link to comment Share on other sites More sharing options...
spudw2k Posted June 23, 2021 Share Posted June 23, 2021 If I understand what you are asking for, you want to automate the User Account Control (UAC) elevation prompt where you need to fill in the admin username and password, is that right? I see two issues going on here. Firstly, the #RequireAdmin declaration essentially pauses the script until either the elevation token (admin right) is obtained, or the script aborts if it fails to obtain the elevation token. Secondly, depending on how UAC is configured, It is possible (and likely) that the UAC elevation prompt runs in a separate, secure desktop which can not be interacted with by an AutoIt script. 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 Link to comment Share on other sites More sharing options...
fby Posted June 23, 2021 Author Share Posted June 23, 2021 Yes correct, could you please share that script? Link to comment Share on other sites More sharing options...
JockoDundee Posted June 23, 2021 Share Posted June 23, 2021 3 hours ago, fby said: please share that script? Which one did you want? The one that has to be aborted, or the one that cannot interact with the desktop? Code hard, but don’t hard code... Link to comment Share on other sites More sharing options...
argumentum Posted June 23, 2021 Share Posted June 23, 2021 On 6/22/2021 at 11:38 AM, fby said: I have tried run this script on login local user but can't run because need local administrator credential, You need to be an Administrator. On 6/22/2021 at 11:38 AM, fby said: what script to add user and password local administrator? Again, you would need to be an administrator to start with. Unless I misinterpreted your text, you are a user that would like to do something that only an Administrator can but you are not an administrator. Talk to the administrator for the PC you would like to add the software to. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
spudw2k Posted June 23, 2021 Share Posted June 23, 2021 (edited) Automating or bypassing security controls--UAC included--is not permitted to discuss per the forum rules. If you need help automating the installer itself, after the process elevation has occurred, we can assist; but I recommend moving forward assuming the operator will need to enter appropriate credentials to elevate the script upon execution. If this is for an enterprise environment, a software deployment solution could be used to address the elevation need, but you will likely be better suited to look into silent install methods as interaction probably won't work. Edited June 23, 2021 by spudw2k Just noticed that typing "forum rules" acts like a keyword and automatically links to the post. NICE! 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 Link to comment Share on other sites More sharing options...
Developers Jos Posted June 24, 2021 Developers Share Posted June 24, 2021 7 hours ago, spudw2k said: Just noticed that typing "forum rules" acts like a keyword and automatically links to the post. NICE! Correct, I added a couple "phrases" since the last upgrade that are commonly used by us. Danp2, Musashi and spudw2k 3 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. 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