Jump to content

Script to add user and password local administrator - (Moved)


Recommended Posts

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 post
Share on other sites

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.  

Link to post
Share on other sites
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.

Link to post
Share on other sites

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 by spudw2k
Just noticed that typing "forum rules" acts like a keyword and automatically links to the post. NICE!
Link to post
Share on other sites
  • Developers
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. :)  

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 post
Share on other sites

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...