Jump to content
Sign in to follow this  

Runas Prompt for username/password

Recommended Posts


Hello Gurus!

I was wondering for the Runas command, if we do not specify the username/password, if we can prompt for it before continuing code. This means

I would like the end users to enter their username/password, instead of it being predefined. Would a GUI have to be used or can we use Runas predefined AutoIt command.

In other words, something like:

RunWait(@COMSPEC & " /c start runas /env /user:$promptuser cmd.exe")

Any ideas appreciated.

Thank you!

Share this post

Link to post
Share on other sites

Use InputBox() to get the username and password from the user. Then just run setup.exe directly with RunAsWait(), no need for the separate CMD shell.


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

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
Sign in to follow this