Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 901
  • Last Modified:

runas command with password

Hi,

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
0
newVtech
Asked:
newVtech
  • 3
  • 2
1 Solution
 
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 http://www.autoitscript.com/site/autoit/
0
 
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.
0
 
GovvyCommented:
What about the runas /savecred switch?
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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 :)
0
 
GovvyCommented:
I see. Runas wont do this: http://blogs.msdn.com/b/oldnewthing/archive/2004/11/29/271551.aspx

Use PSEXEC from WinInternals instead
0
 
newVtechAuthor Commented:
Ok that seems to have worked. Thank you.
0

Featured Post

 The Evil-ution of Network Security Threats

What are the hacks that forever changed the security industry? To answer that question, we created an exciting new eBook that takes you on a trip through hacking history. It explores the top hacks from the 80s to 2010s, why they mattered, and how the security industry responded.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now