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?

link|improve this question

61% accept rate
feedback

3 Answers

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.

link|improve this answer
feedback

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

link|improve this answer
feedback

You'll need to map the drive. use Net use to do this then use the runas to the drive letter you assign. (like net use z: \\someshare)

link|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
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.