Jump to content
jacobestepp

Need help selecting CMD prompt to accept text.

Recommended Posts

jacobestepp

I am very new to AUTOIT (Like about 5 minutes) I run through the same check list to install software and and set up new computers maybe 20-30 times a month, so I figure this will perfect for my situation.  I am working on a script that will install several components, but I'm having an issue early on.   I need the script to open the command prompt as administrator in windows 10 on a fresh install. so there will be a User setup in the computer with admin rights, but it will be a different user on every machine. how can I open the command prompt and write text to it as administrator?

Send ("#r")
WinWaitActive("Run")
    Send("runas /user:Administrator cmd")
        Send("{Enter}")

 

Share this post


Link to post
Share on other sites
Subz
Posted (edited)

Use #RequireAdmin at the top of your script

Or

ShellExecute("CMD", "/k", "", "RunAs")

Edited by Subz

Share this post


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

×