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 want to execute a file on a share but I need to use a domain account to access it. I've tried runas /user:domain\user \\someshare\foo.exe. It prompts for the domain account's password, which I enter, but then I get "RUNAS ERROR: Unable to run... 2: The system cannot find the file specified." Is this possible with runas? Is there another way to accomplish this from command line?

share|improve this question
up vote 2 down vote accepted

Network connections are per-session and aren't carried over by runas.

You need to runas /u:domain\user cmd first.

share|improve this answer

If you only need to use the admin account to access the file, have you tried using the /netonly switch?

share|improve this answer

You'll need to map the drive. Use NET USE to do this and then use runas to the drive letter you assign, like

net use z: \\someshare
share|improve this answer
I'm still getting the same error. – Steven May 18 '11 at 19:16
@Steven Try this then, Browse to the program and Shift Right Click on the program and click Run as different user then enter your credentials. – Jeff F. May 18 '11 at 19:31
I can't browse to the program as the current user because the current user is not a domain account and therefore does not have access to it. – Steven May 19 '11 at 17:06

You must log in to answer this question.

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