Solved

runas command with password

Posted on 2011-09-19
6
872 Views
Last Modified: 2012-05-12
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
Comment
Question by:newVtech
  • 3
  • 2
6 Comments
 
LVL 26

Expert Comment

by:Thomas Zucker-Scharff
ID: 36561675
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
 

Author Comment

by:newVtech
ID: 36561890
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
 
LVL 13

Expert Comment

by:Govvy
ID: 36561979
What about the runas /savecred switch?
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 

Author Comment

by:newVtech
ID: 36562019
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
 
LVL 13

Accepted Solution

by:
Govvy earned 500 total points
ID: 36562223
I see. Runas wont do this: http://blogs.msdn.com/b/oldnewthing/archive/2004/11/29/271551.aspx

Use PSEXEC from WinInternals instead
0
 

Author Comment

by:newVtech
ID: 36562305
Ok that seems to have worked. Thank you.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

How can you create a game plan that lets you focus on special projects instead of running from cubicle to cubicle every day and feeling like you’ve accomplished nothing? Try these strategies for prioritizing your tasks, offloading what you can, and …
Our Group Policy work started with Small Business Server in 2000. Microsoft gave us an excellent OU and GPO model in subsequent SBS editions that utilized WMI filters, OU linking, and VBS scripts. These are some of experiences plus our spending a lo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now