runas command with password


I`m trying to create a batch script that runs an application as admin.

My problem is that i can`t enter the password into the script... from what i`ve read around it seems runas doesn`t accept a password parameter. Can you please give me any alternatives?

Thank you
Who is Participating?
GovvyConnect With a Mentor Commented:
I see. Runas wont do this:

Use PSEXEC from WinInternals instead
Thomas Zucker-ScharffSystems AnalystCommented:
Ibelieve AutoIT can take a password as a parameter and then it creates a script as an exe so the password is not as easily seen.  There is a free trial on their site
newVtechAuthor Commented:
I`ve tried autoit some time ago. But i need something that is small preferably just an executable that does exactly what runas does and also accepts passwords.
We Need Your Input!

WatchGuard is currently running a beta program for our new macOS Host Sensor for our Threat Detection and Response service. We're looking for more macOS users to help provide insight and feedback to help us make the product even better. Please sign up for our beta program today!

What about the runas /savecred switch?
newVtechAuthor Commented:
Well for the /savecred switch to work you would have to enter the pass once.
I`d prefer to have it in a nice script... I`m thinking of something like:

 runas /user:domain\name /password:pass <command>

If i use this script to install software onto 50 pcs i`ll have to type the password in each time. I want everything automated :)
newVtechAuthor Commented:
Ok that seems to have worked. Thank you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.