I'm trying to execute commands to a remote server offsite and PSExec for some reason is not working.

C:\> psexec \\LOC-Server -u AdminUser -p AdminPW cmd

This won't even let me run command prompt. But when I RDP into \\LOC-Server with the AdminUser and AdminPW credentials I'm able to get on it.

What am I doing wrong?

EDIT: I have also tried Domain\AdminUser but that hasn't worked either.

  • This is a comment and not an answer but my rep is too low to post comments. Can you access admin shares on the target computer? e.g. open \\LOC-Server\admin$ or \\LOC-Server\c$ with a explorer. If that works its not a problem of access rights. Maybe the psexec service is already running on the server and is using a different version (in that case remove it and make sure you are using the most recent one). The service is installed on the first use of psexec. – weberik Oct 28 '11 at 16:03
  • Have you tried specifying the full path to the command? I've found psexec is somewhat unreliable when no path is specified, even if the path is in the PATH environment variable of either the system or the user running the command. – John Gardeniers Oct 28 '11 at 18:42

Try doing it like this:

psexec \\LOC-Server -u **DOMAIN**\AdminUser -p AdminPW cmd

Or, it could be due to:

psexec \\LOC-Server -u AdminUser -p AdminPW **cmd.exe**
  • Neither work :( what do you mean weird backslashes? Am I missing a backslash somewhere in my command? – jayjyli Oct 28 '11 at 14:13

I would suggest disabling Simple File Sharing on the target machine. Tools > Folder options > View tab, scroll to bottom and uncheck Simple File Sharing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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