PSEXEC The system cannot find the file specified error

giacmeister picture giacmeister · Jul 21, 2014 · Viewed 14k times · Source

I'm trying to run a batch script on multiple servers using a vbscript that's from another server. I'm using psexec on my local machine to run this batch script.

This is the script I'm running:(This is server 2003)

    psexec -s -accepteula \\SERVERNAME -u userName -p DOMAIN\password cmd.exe
    /c cscript \\otherServerName\c$\folder\script.vbs

I'm getting this error:

    Error establishing communication with PsExec service on SERVERNAME
    The system cannot find the file specified.

I'm running this script on server 2003, 2008, and 2012. When I try to run the script on a server 2008 server it gives me an "access denied" error despite the fact that I'm using administrator credentials.

Answer

adipy picture adipy · Sep 18, 2014

Maybe you just copied the command incorrectly, but DOMAIN\ should precede the userName, not the password.

I am also having the same error though, with the very simple command

psexec \\SERVER cmd

I've found it seems to be a problem with PsTools 2.1; I can execute this command with PsTools 1.98 and it works fine. You might want to try using a different version of PsTools.