Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to run the "runas" command for log on automatically an Application User, on an Active Directory. Then I need run an executable file.

Can I do this in some way or work around to do not type the password?

share|improve this question
Is this batch file running at startup or logon? A bit more info may help get an answer. – Dave M Jan 5 '12 at 19:44
up vote 3 down vote accepted


Runas might not be supported but you could use a freeware utility CPAU

This utility will allow you to launch an application using a different set of credentials then the current user. The neat advantage with CPAU over runas is that you can specify both the username and password at runtime. With the runas command you'd first have to configure a cached credential or be prompted for password at each run.


Using CPAU to launch iexplore.exe you could use a statement like:

from cmd prompt:

cd <path to cpau> -d
cpau.exe  /u domain\username  /p 123456  /ex "c:\Program Files (x86)\Internet Explorer\iexplore.exe" /lwp

from powershell script:

cd <path to cpau> -d
invoke-expression "cpau.exe  /u 'domain\username'  /p '123456'  /ex 'c:\Program Files (x86)\Internet Explorer\iexplore.exe' /lwp"

/lwp means to Load With Profile, and can be replaced with /lwop Load Without Profile

share|improve this answer
I do this: Open cmd as Administrator. Then I use command cpau -u domain\username -p xxx -ex "C:\windows\explorer.exe " but I get error Windows cannot access the specificed device, path, or file. Yoy may not have the appropiate permissions to access the item. And its appears another dialog with title shell:::{52205fd8-5dfb-447d-801a-d0b52f2e83e1} and the same error message. – Kiquenet Feb 10 '15 at 15:27
It's probably because you didn't install the utility properly. – Anup Kattel Feb 13 '15 at 3:31

what about RUNASSPC? You create an certificate for needed program, the password et. is saved as encrypted file so for example guest user can run only the particular software as administrator. RUNASSPC window

and the license:

RunasSpc is free for private use. For companies we deliver a licensed version of runasspc, registered to the enterprise`s name..

share|improve this answer
For domains it need registration – Leandro Tupone Jan 6 '12 at 14:32

Use option /savecred, then the password will be saved when you have typed it and not asked for again. (You can can use "runas /?" to get help for this command.)

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .