Solved

runas command with password

Posted on 2011-09-19
6
873 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
DHCP backups are using a lot of space 3 57
Post install of Win8 14 51
SCCM 2012 Application packaging 4 64
Suggestions for career in IT 11 82
One of the most frustrating experiences a help desk technician will ever encounter is when a customer comes to them with a solution of their own invention and expects the tech to implement it. This often happens when people with a little bit of tech…
When we talk about DevOps toolchains, I sometimes wonder how many people really get what we’re talking about. I don’t know if it’s just semantics or tone or something else, but sometimes I think it just sounds like buzzword sausage. So it’s always …
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
Send secure, cloud-based, encrypted alerts and maintain HIPAA compliant messaging. Integrates priority & secure messaging into one application. Ensures IT, emergency respondents and healthcare professionals that their critical messages are never mis…

914 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

18 Experts available now in Live!

Get 1:1 Help Now