As you can see from the screenshot below, C:\Windows\system32\cmd.exe exists (since the command prompt itself is using that path), and I try referencing it both with the short cmd.exe name and the full path, but both result in the same error from PsExec.exe:

The system cannot find the specified file.

The Network Service user does exist; if I mistype if I get a password prompt and message saying that the username password does not exist.

I receive this error message on multiple computers, but it works on others; with a mix of Windows Server 2008 R2 and 2012 R2. I and am using the latest version of PsExec.exe, which is currently 2.11, and am running the command prompt that I use to launch PsExec as admin, so it should have any necessary permissions.

I've found lots of posts about seeing this problem when running PsExec on a remote machine, but none for the local machine, which I am doing.

Any ideas on what is the problem?

enter image description here

  • 1
    try psexec \\localhost -i -u "NT AUTHORITY\NETWORK SERVICE" cmd. Personally, I've seen lots of people have problems with the username/password specs for psexec, so I wonder if they aren't a little buggy. Edit, I got the same error until I specified localhost. – Frank Thomas Sep 25 '15 at 23:02
  • I still get the same error when I include \\localhost as you suggested @FrankThomas – deadlydog Sep 27 '15 at 14:04
  • odd, that exact command works fine for me. is the command prompt elevated? did you use cmd instead of the full path? – Frank Thomas Sep 27 '15 at 17:12
  • Yeah, as I mentioned in my post, the exact same command works on some servers, but not others. – deadlydog Sep 28 '15 at 19:08

The fix ended up being to NOT run the command prompt that I was launching PsExec from as admin. If I run the command from a cmd prompt running as Admin, I get the error. If I run it from a non-elevated command prompt, it works fine.

| improve this answer | |
  • 5
    Does anyone know why this would make a difference? – user1354557 Jul 7 '16 at 13:29

Another reason this may happen is you have stopped or disabled LanmanServer (Server) or LanmanWorkstation (Workstation) services.

The way PsExec works, it needs those to function.

| improve this answer | |
  • 1
    I had the same issue, and restarting the Server and Workstation services fixed the issue. They were up according to the Services MMC, but PSEXEC wouldn't work until they were restarted. – Jason Jun 1 '17 at 17:23

I also found that if I copy PSExec to another directory (and the Sysinternals directory is not on PATH) and try to run it from there, it will fail as above. If I run PSExec on the Sysinternals directory then the -s option will work.

So, another item to check is to make sure that either the Sysinternals folder is on the path or that PSExec is executed from that directory.

Apparently, it needs another Sysinternals executable...

| improve this answer | |

I had the same problem, the solution was to disable windows defender's Real-Time protection. This was blocking the psexec operation.

| improve this answer | |

What fixed it for me was executing the 'psexec' command from the default cmd location (c:\windows\system32 in my case) and give the full path to the argument (the app you're running):

C:\WINDOWS\system32>psexec c:\Projects\newdesktop\someapp.exe

| improve this answer | |

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.