psexec error "access denied"


I am trying to execute a program remotely on another computer using psexec. Therefore I created a user account which has administrational rights on that machine. The Path to the program is known and the program does not need to be copied to that remote machine. For launching the program I use a command script which passes some arguments to the program. The program is an interactive application which should be aware of user input on the remote computer.

I tried the following commands:

psexec \\remote -u user -p pwd -e -i path\to\program.exe
psexec \\remote -u user -p pwd -e path\to\program.exe
psexec \\remote -u user -p pwd -i path\to\program.exe
psexec \\remote -u user -p pwd path\to\program.exe

Unfortunately it seems that some kind of permission has to be present for the user to execute the program since I get always the error "access denied".

Any ideas what i am doing wrong or what kind of permission i forgot?

best regards

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is the domain of the username that you use, the same domain than your account ?

Else used :
psexec \\remote -u "domain\user" -p "pwd" path\to\program.exe

califaxAuthor Commented:
The target machines are not members of a domain. They are just connected via a crossed ethernet cable and are members of a workgroup. This is why I tried using the name of the computer instead of a domain name. The machines are fsc1 and fsc2. On both machines there exists a user account "herbert" which has administrative rights (e.g. it is member in the administrators group). When I tested from fsc1, I used:

psexec \\fsc2 -u FSC2\herbert -p herbertsPW -e command

This always gave me the result "access denied".

I would guess that the passwords on the two machines are different for their respective users?
My suggestion: do not use the same user name for both. use something else for the second machine.
Otherwise, use the same password for that username on both machines. this will also do the trick (although much less secure, which I guess is not a problem here, since you got the machines crosswired).

Since you are logged in as herbert on the first machine, and already have a connection to the second machine with that name, what happens when you execute something on the 2nd machine, with the same username in the parameter (even with a different  domain/computer name), is that windows will disregard the domain/computer part and only take the username part. therefore, since those accounts have different passwords, you get the access denied.
this is by design of the authentication algorithm, as far as I can remember it..
Hope it helps.

Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

califaxAuthor Commented:
I understand what you're saying. unfortunately the passwords are the same.

Maybe I should have said this earlier. I am using Windows XP Pro. Could it be that the authentication scheme has changed there?

sry, if this has been a crucial information.


Have you tried without username informations ?

psexec \\fsc2 command

califaxAuthor Commented:
yes, I tried that too

what is the command that you used ?

to be sure that is a psexec problem : Have you tried to run this command ?

(it's necessary that a user are logged on the target computer)
psexec \\fsc2 explorer.exe

If it works, could you check your command.exe(be careful if this command must be used with an specially account)

Hi again,
I've re-read the whole thing, and it seems to me that we've overlooked something, so let's go to the basics:
1. both machines are wxp, in a workgroup, right?
2. both machines have a username herbert, same pwd, on them, with admin rights.
3. you're logged on as herbert on machine1
If I'm right so far then let's try the following:

1. try to connect to machine2's c$.  this will show you if ou have admin rights on the other machine too.
if you can, we're good, and you can try that psexec again (with the connection intact).
2. if you can't (as I suspect), then you simply don't have perms on the second machine... put machine1\herbert in the adminsgroup of machine2... then try again

As far as psexec: the way it actually works, is that it installs a service on machine2, then that service runs yor command using the RunAs api... Now,assuming I'm correct, if you're not admin on machine2, the Access denied error actually comes from failing to install the service, not running the cmmand itself.

Sorry for the long comments.... :)
good luck.
bbaoIT ConsultantCommented:
use "psexec -s" with your other parameters, that it goes fine.
bbaoIT ConsultantCommented:
califax, are you here with us? i am VERY sure that "psexec -s" is your solution, just have a try.
I am having the same problem.  I don't think it is anything to do with pstools/psexec.  I cannot connect to Computer Management on the affected machines either.  Some suggestions that have worked for other people have included looking at firewall setings to see if they let RPC through.  You could also try permissions on the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg key (see question 20755493 at  These haven'y worked for me, but they were good ideas.
Just fixed it -- Windows XP enables Simple File Sharing by default.  It treats all network users as Guest accounts.  Because of this you get Access Denied messages for a range of things including pstools, accessing C$ shares and remotely operating Computer Management. When I disabled it it all started working.   You can find it in Folder Options at the bottom of the view tab.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
califaxAuthor Commented:
Great. This solved the problem immediately ;) I thank all you guys very much for your help. (@bbao: I was with you all the time ;)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Networking

From novice to tech pro — start learning today.